00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef PARSEPOS_H
00017 #define PARSEPOS_H
00018
00019 #include "unicode/utypes.h"
00020 #include "unicode/uobject.h"
00021
00022
00023 U_NAMESPACE_BEGIN
00024
00047 class U_COMMON_API ParsePosition : public UObject {
00048 public:
00053 ParsePosition()
00054 : UObject(),
00055 index(0),
00056 errorIndex(-1)
00057 {}
00058
00064 ParsePosition(int32_t newIndex)
00065 : UObject(),
00066 index(newIndex),
00067 errorIndex(-1)
00068 {}
00069
00075 ParsePosition(const ParsePosition& copy)
00076 : UObject(copy),
00077 index(copy.index),
00078 errorIndex(copy.errorIndex)
00079 {}
00080
00085 virtual ~ParsePosition();
00086
00091 ParsePosition& operator=(const ParsePosition& copy);
00092
00098 UBool operator==(const ParsePosition& that) const;
00099
00105 UBool operator!=(const ParsePosition& that) const;
00106
00118 ParsePosition *clone() const;
00119
00127 int32_t getIndex(void) const;
00128
00134 void setIndex(int32_t index);
00135
00143 void setErrorIndex(int32_t ei);
00144
00150 int32_t getErrorIndex(void) const;
00151
00157 static UClassID U_EXPORT2 getStaticClassID();
00158
00164 virtual UClassID getDynamicClassID() const;
00165
00166 private:
00173 int32_t index;
00174
00178 int32_t errorIndex;
00179
00180 };
00181
00182 inline ParsePosition&
00183 ParsePosition::operator=(const ParsePosition& copy)
00184 {
00185 index = copy.index;
00186 errorIndex = copy.errorIndex;
00187 return *this;
00188 }
00189
00190 inline UBool
00191 ParsePosition::operator==(const ParsePosition& copy) const
00192 {
00193 if(index != copy.index || errorIndex != copy.errorIndex)
00194 return FALSE;
00195 else
00196 return TRUE;
00197 }
00198
00199 inline UBool
00200 ParsePosition::operator!=(const ParsePosition& copy) const
00201 {
00202 return !operator==(copy);
00203 }
00204
00205 inline int32_t
00206 ParsePosition::getIndex() const
00207 {
00208 return index;
00209 }
00210
00211 inline void
00212 ParsePosition::setIndex(int32_t offset)
00213 {
00214 this->index = offset;
00215 }
00216
00217 inline int32_t
00218 ParsePosition::getErrorIndex() const
00219 {
00220 return errorIndex;
00221 }
00222
00223 inline void
00224 ParsePosition::setErrorIndex(int32_t ei)
00225 {
00226 this->errorIndex = ei;
00227 }
00228 U_NAMESPACE_END
00229
00230 #endif