ICU 56.1: fieldpos.h Source File

ICU 56.1 56.1

- Main Page
- Related Pages
- Modules
- Namespaces
- Data Structures
- Files

- File List
- Globals

fieldpos.h
Go to the documentation of this file.
1 /*
2 ********************************************************************************
3 * Copyright (C) 1997-2006, International Business Machines
4 * Corporation and others. All Rights Reserved.
5 ********************************************************************************
6 *
7 * File FIELDPOS.H
8 *
9 * Modification History:
10 *
11 * Date Name Description
12 * 02/25/97 aliu Converted from java.
13 * 03/17/97 clhuang Updated per Format implementation.
14 * 07/17/98 stephen Added default/copy ctors, and operators =, ==, !=
15 ********************************************************************************
16 */
17
18 // *****************************************************************************
19 // This file was generated from the java source file FieldPosition.java
20 // *****************************************************************************
21
22 #ifndef FIELDPOS_H
23 #define FIELDPOS_H
24
25 #include "unicode/utypes.h"
26
32 #if !UCONFIG_NO_FORMATTING
33
34 #include "unicode/uobject.h"
35
36 U_NAMESPACE_BEGIN
37
106 class U_I18N_API FieldPosition : public UObject {
107 public:
112 enum { DONT_CARE = -1 };
113
118 FieldPosition()
119 : UObject(), fField(DONT_CARE), fBeginIndex(0), fEndIndex(0) {}
120
132 FieldPosition(int32_t field)
133 : UObject(), fField(field), fBeginIndex(0), fEndIndex(0) {}
134
140 FieldPosition(const FieldPosition& copy)
141 : UObject(copy), fField(copy.fField), fBeginIndex(copy.fBeginIndex), fEndIndex(copy.fEndIndex) {}
142
147 virtual ~FieldPosition();
148
154 FieldPosition& operator=(const FieldPosition& copy);
155
162 UBool operator==(const FieldPosition& that) const;
163
170 UBool operator!=(const FieldPosition& that) const;
171
183 FieldPosition *clone() const;
184
190 int32_t getField(void) const { return fField; }
191
197 int32_t getBeginIndex(void) const { return fBeginIndex; }
198
206 int32_t getEndIndex(void) const { return fEndIndex; }
207
213 void setField(int32_t f) { fField = f; }
214
220 void setBeginIndex(int32_t bi) { fBeginIndex = bi; }
221
227 void setEndIndex(int32_t ei) { fEndIndex = ei; }
228
234 virtual UClassID getDynamicClassID() const;
235
241 static UClassID U_EXPORT2 getStaticClassID();
242
243 private:
248 int32_t fField;
249
254 int32_t fBeginIndex;
255
260 int32_t fEndIndex;
261 };
262
263 inline FieldPosition&
264 FieldPosition::operator=(const FieldPosition& copy)
265 {
266 fField = copy.fField;
267 fEndIndex = copy.fEndIndex;
268 fBeginIndex = copy.fBeginIndex;
269 return *this;
270 }
271
272 inline UBool
273 FieldPosition::operator==(const FieldPosition& copy) const
274 {
275 return (fField == copy.fField &&
276 fEndIndex == copy.fEndIndex &&
277 fBeginIndex == copy.fBeginIndex);
278 }
279
280 inline UBool
281 FieldPosition::operator!=(const FieldPosition& copy) const
282 {
283 return !operator==(copy);
284 }
285
286 U_NAMESPACE_END
287
288 #endif /* #if !UCONFIG_NO_FORMATTING */
289
290 #endif // _FIELDPOS
291 //eof
icu::UObject::getDynamicClassID
virtual UClassID getDynamicClassID() const
ICU4C "poor man's RTTI", returns a UClassID for the actual ICU class.
icu::FieldPosition::FieldPosition
FieldPosition(int32_t field)
Creates a FieldPosition object for the given field.
Definition: fieldpos.h:132
icu::FieldPosition::setField
void setField(int32_t f)
Set the field.
Definition: fieldpos.h:213
icu::FieldPosition::setEndIndex
void setEndIndex(int32_t ei)
Set the end index.
Definition: fieldpos.h:227
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's RTTI.
Definition: uobject.h:91
icu::FieldPosition::getField
int32_t getField(void) const
Retrieve the field identifier.
Definition: fieldpos.h:190
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:358
U_NAMESPACE_BEGIN
#define U_NAMESPACE_BEGIN
This is used to begin a declaration of a public ICU C++ API.
Definition: uversion.h:129
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:206
icu::operator!=
UBool operator!=(const StringPiece &x, const StringPiece &y)
Global operator != for StringPiece.
Definition: stringpiece.h:218
icu::FieldPosition::getBeginIndex
int32_t getBeginIndex(void) const
Retrieve the index of the first character in the requested field.
Definition: fieldpos.h:197
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:130
icu::FieldPosition
FieldPosition is a simple class used by Format and its subclasses to identify fields in formatted out...
Definition: fieldpos.h:106
icu::FieldPosition::setBeginIndex
void setBeginIndex(int32_t bi)
Set the begin index.
Definition: fieldpos.h:220
icu::FieldPosition::FieldPosition
FieldPosition()
Creates a FieldPosition object with a non-specified field.
Definition: fieldpos.h:118
utypes.h
Basic definitions for ICU, for both C and C++ APIs.
icu::FieldPosition::FieldPosition
FieldPosition(const FieldPosition &copy)
Copy constructor.
Definition: fieldpos.h:140
icu::UObject
UObject is the common ICU "boilerplate" class.
Definition: uobject.h:221
UBool
int8_t UBool
The ICU boolean type.
Definition: umachine.h:234