ICU 63.1 63.1

fieldpos.h
Go to the documentation of this file.
1 // © 2016 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
3 /*
4 ********************************************************************************
5 * Copyright (C) 1997-2006, International Business Machines
6 * Corporation and others. All Rights Reserved.
7 ********************************************************************************
8 *
9 * File FIELDPOS.H
10 *
11 * Modification History:
12 *
13 * Date Name Description
14 * 02/25/97 aliu Converted from java.
15 * 03/17/97 clhuang Updated per Format implementation.
16 * 07/17/98 stephen Added default/copy ctors, and operators =, ==, !=
17 ********************************************************************************
18 */
19
20 // *****************************************************************************
21 // This file was generated from the java source file FieldPosition.java
22 // *****************************************************************************
23
24 #ifndef FIELDPOS_H
25 #define FIELDPOS_H
26
27 #include "unicode/utypes.h"
28
34 #if !UCONFIG_NO_FORMATTING
35
36 #include "unicode/uobject.h"
37
38 U_NAMESPACE_BEGIN
39
108 class U_I18N_API FieldPosition : public UObject {
109 public:
115 enum { DONT_CARE = -1 };
116
121 FieldPosition()
122 : UObject(), fField(DONT_CARE), fBeginIndex(0), fEndIndex(0) {}
123
135 FieldPosition(int32_t field)
136 : UObject(), fField(field), fBeginIndex(0), fEndIndex(0) {}
137
143 FieldPosition(const FieldPosition& copy)
144 : UObject(copy), fField(copy.fField), fBeginIndex(copy.fBeginIndex), fEndIndex(copy.fEndIndex) {}
145
150 virtual ~FieldPosition();
151
157 FieldPosition& operator=(const FieldPosition& copy);
158
165 UBool operator==(const FieldPosition& that) const;
166
173 UBool operator!=(const FieldPosition& that) const;
174
186 FieldPosition *clone() const;
187
193 int32_t getField(void) const { return fField; }
194
200 int32_t getBeginIndex(void) const { return fBeginIndex; }
201
209 int32_t getEndIndex(void) const { return fEndIndex; }
210
216 void setField(int32_t f) { fField = f; }
217
223 void setBeginIndex(int32_t bi) { fBeginIndex = bi; }
224
230 void setEndIndex(int32_t ei) { fEndIndex = ei; }
231
237 virtual UClassID getDynamicClassID() const;
238
244 static UClassID U_EXPORT2 getStaticClassID();
245
246 private:
251 int32_t fField;
252
257 int32_t fBeginIndex;
258
263 int32_t fEndIndex;
264 };
265
266 inline FieldPosition&
267 FieldPosition::operator=(const FieldPosition& copy)
268 {
269 fField = copy.fField;
270 fEndIndex = copy.fEndIndex;
271 fBeginIndex = copy.fBeginIndex;
272 return *this;
273 }
274
275 inline UBool
276 FieldPosition::operator==(const FieldPosition& copy) const
277 {
278 return (fField == copy.fField &&
279 fEndIndex == copy.fEndIndex &&
280 fBeginIndex == copy.fBeginIndex);
281 }
282
283 inline UBool
284 FieldPosition::operator!=(const FieldPosition& copy) const
285 {
286 return !operator==(copy);
287 }
288
289 U_NAMESPACE_END
290
291 #endif /* #if !UCONFIG_NO_FORMATTING */
292
293 #endif // _FIELDPOS
294 //eof
icu::FieldPosition::FieldPosition
FieldPosition(int32_t field)
Creates a FieldPosition object for the given field.
Definition: fieldpos.h:135
icu::FieldPosition::setField
void setField(int32_t f)
Set the field.
Definition: fieldpos.h:216
icu::FieldPosition::setEndIndex
void setEndIndex(int32_t ei)
Set the end index.
Definition: fieldpos.h:230
icu::FieldPosition::getEndIndex
int32_t getEndIndex(void) const
Retrieve the index of the character following the last character in the requested field...
Definition: fieldpos.h:209
icu::operator==
U_EXPORT UBool operator==(const StringPiece &x, const StringPiece &y)
Global operator == for StringPiece.
UClassID
void * UClassID
UClassID is used to identify classes without using the compiler&#39;s RTTI.
Definition: uobject.h:90
U_I18N_API
#define U_I18N_API
Set to export library symbols from inside the i18n library, and to import them from outside...
Definition: utypes.h:301
U_NAMESPACE_BEGIN
#define U_NAMESPACE_BEGIN
This is used to begin a declaration of a public ICU C++ API.
Definition: uversion.h:137
icu::operator!=
UBool operator!=(const StringPiece &x, const StringPiece &y)
Global operator != for StringPiece.
Definition: stringpiece.h:218
icu::UObject::getDynamicClassID
virtual UClassID getDynamicClassID() const
ICU4C "poor man&#39;s RTTI", returns a UClassID for the actual ICU class.
uobject.h
C++ API: Common ICU base class UObject.
U_NAMESPACE_END
#define U_NAMESPACE_END
This is used to end a declaration of a public ICU C++ API.
Definition: uversion.h:138
icu::FieldPosition
FieldPosition is a simple class used by Format and its subclasses to identify fields in formatted out...
Definition: fieldpos.h:108
icu::FieldPosition::setBeginIndex
void setBeginIndex(int32_t bi)
Set the begin index.
Definition: fieldpos.h:223
icu::FieldPosition::FieldPosition
FieldPosition()
Creates a FieldPosition object with a non-specified field.
Definition: fieldpos.h:121
utypes.h
Basic definitions for ICU, for both C and C++ APIs.
icu::FieldPosition::FieldPosition
FieldPosition(const FieldPosition &copy)
Copy constructor.
Definition: fieldpos.h:143
icu::FieldPosition::getField
int32_t getField(void) const
Retrieve the field identifier.
Definition: fieldpos.h:193
icu::UObject
UObject is the common ICU "boilerplate" class.
Definition: uobject.h:220
UBool
int8_t UBool
The ICU boolean type.
Definition: umachine.h:225
icu::FieldPosition::getBeginIndex
int32_t getBeginIndex(void) const
Retrieve the index of the first character in the requested field.
Definition: fieldpos.h:200