/* * Copyright © {1997-1999}, International Business Machines Corporation and others. All Rights Reserved. ******************************************************************************* * * File PARSEPOS.H * * Modification History: * * Date Name Description * 07/09/97 helena Converted from java. * 07/17/98 stephen Added errorIndex support. * 05/11/99 stephen Cleaned up. ******************************************************************************* */ #ifndef PARSEPOS_H #define PARSEPOS_H #include "unicode/utypes.h" class U_I18N_API ParsePosition { public: ParsePosition() { this->index = 0; this->errorIndex = -1; } ParsePosition(UTextOffset newIndex) { this->index = newIndex; this->errorIndex = -1; } ParsePosition(const ParsePosition& copy) { this->index = copy.index; this->errorIndex = copy.errorIndex; } ~ParsePosition() {} ParsePosition& operator=(const ParsePosition& copy); UBool operator==(const ParsePosition& that) const; UBool operator!=(const ParsePosition& that) const; UTextOffset getIndex(void) const; void setIndex(UTextOffset index); void setErrorIndex(UTextOffset ei); UTextOffset getErrorIndex(void) const; private: UTextOffset index; UTextOffset errorIndex; }; inline ParsePosition& ParsePosition::operator=(const ParsePosition& copy) { index = copy.index; errorIndex = copy.errorIndex; return *this; } inline UBool ParsePosition::operator==(const ParsePosition& copy) const { if(index != copy.index || errorIndex != copy.errorIndex) return FALSE; else return TRUE; } inline UBool ParsePosition::operator!=(const ParsePosition& copy) const { return !operator==(copy); } inline UTextOffset ParsePosition::getIndex() const { return index; } inline void ParsePosition::setIndex(UTextOffset offset) { this->index = offset; } inline UTextOffset ParsePosition::getErrorIndex() const { return errorIndex; } inline void ParsePosition::setErrorIndex(UTextOffset ei) { this->errorIndex = ei; } #endif