00001 // © 2016 and later: Unicode, Inc. and others. 00002 // License & terms of use: http://www.unicode.org/copyright.html 00003 /* 00004 ******************************************************************************** 00005 * Copyright (C) 1997-2006, International Business Machines 00006 * Corporation and others. All Rights Reserved. 00007 ******************************************************************************** 00008 * 00009 * File FIELDPOS.H 00010 * 00011 * Modification History: 00012 * 00013 * Date Name Description 00014 * 02/25/97 aliu Converted from java. 00015 * 03/17/97 clhuang Updated per Format implementation. 00016 * 07/17/98 stephen Added default/copy ctors, and operators =, ==, != 00017 ******************************************************************************** 00018 */ 00019 00020 // ***************************************************************************** 00021 // This file was generated from the java source file FieldPosition.java 00022 // ***************************************************************************** 00023 00024 #ifndef FIELDPOS_H 00025 #define FIELDPOS_H 00026 00027 #include "unicode/utypes.h" 00028 00034 #if !UCONFIG_NO_FORMATTING 00035 00036 #include "unicode/uobject.h" 00037 00038 U_NAMESPACE_BEGIN 00039 00108 class U_I18N_API FieldPosition : public UObject { 00109 public: 00115 enum { DONT_CARE = -1 }; 00116 00121 FieldPosition() 00122 : UObject(), fField(DONT_CARE), fBeginIndex(0), fEndIndex(0) {} 00123 00135 FieldPosition(int32_t field) 00136 : UObject(), fField(field), fBeginIndex(0), fEndIndex(0) {} 00137 00143 FieldPosition(const FieldPosition& copy) 00144 : UObject(copy), fField(copy.fField), fBeginIndex(copy.fBeginIndex), fEndIndex(copy.fEndIndex) {} 00145 00150 virtual ~FieldPosition(); 00151 00157 FieldPosition& operator=(const FieldPosition& copy); 00158 00165 UBool operator==(const FieldPosition& that) const; 00166 00173 UBool operator!=(const FieldPosition& that) const; 00174 00186 FieldPosition *clone() const; 00187 00193 int32_t getField(void) const { return fField; } 00194 00200 int32_t getBeginIndex(void) const { return fBeginIndex; } 00201 00209 int32_t getEndIndex(void) const { return fEndIndex; } 00210 00216 void setField(int32_t f) { fField = f; } 00217 00223 void setBeginIndex(int32_t bi) { fBeginIndex = bi; } 00224 00230 void setEndIndex(int32_t ei) { fEndIndex = ei; } 00231 00237 virtual UClassID getDynamicClassID() const; 00238 00244 static UClassID U_EXPORT2 getStaticClassID(); 00245 00246 private: 00251 int32_t fField; 00252 00257 int32_t fBeginIndex; 00258 00263 int32_t fEndIndex; 00264 }; 00265 00266 inline FieldPosition& 00267 FieldPosition::operator=(const FieldPosition& copy) 00268 { 00269 fField = copy.fField; 00270 fEndIndex = copy.fEndIndex; 00271 fBeginIndex = copy.fBeginIndex; 00272 return *this; 00273 } 00274 00275 inline UBool 00276 FieldPosition::operator==(const FieldPosition& copy) const 00277 { 00278 return (fField == copy.fField && 00279 fEndIndex == copy.fEndIndex && 00280 fBeginIndex == copy.fBeginIndex); 00281 } 00282 00283 inline UBool 00284 FieldPosition::operator!=(const FieldPosition& copy) const 00285 { 00286 return !operator==(copy); 00287 } 00288 00289 U_NAMESPACE_END 00290 00291 #endif /* #if !UCONFIG_NO_FORMATTING */ 00292 00293 #endif // _FIELDPOS 00294 //eof
1.6.1