00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
#ifndef FIELDPOS_H
00022
#define FIELDPOS_H
00023
00024
#include "unicode/utypes.h"
00025
00026 U_NAMESPACE_BEGIN
00027
00094 class U_I18N_API FieldPosition {
00095
public:
00100
enum { DONT_CARE = -1 };
00101
00106 FieldPosition()
00107 : fField(DONT_CARE), fBeginIndex(0), fEndIndex(0) {}
00108
00120 FieldPosition(int32_t field)
00121 : fField(field), fBeginIndex(0), fEndIndex(0) {}
00122
00128 FieldPosition(
const FieldPosition& copy)
00129 : fField(copy.fField), fBeginIndex(copy.fBeginIndex), fEndIndex(copy.fEndIndex) {}
00130
00135 ~FieldPosition() {}
00136
00141 FieldPosition& operator=(
const FieldPosition& copy);
00142
00148 UBool operator==(
const FieldPosition& that)
const;
00149
00155 UBool operator!=(
const FieldPosition& that)
const;
00156
00161 int32_t getField(
void)
const {
return fField; }
00162
00167 int32_t getBeginIndex(
void)
const {
return fBeginIndex; }
00168
00174 int32_t getEndIndex(
void)
const {
return fEndIndex; }
00175
00180 void setField(int32_t f) { fField = f; }
00181
00186 void setBeginIndex(int32_t bi) { fBeginIndex = bi; }
00187
00192 void setEndIndex(int32_t ei) { fEndIndex = ei; }
00193
00194
private:
00199 int32_t fField;
00200
00205 int32_t fBeginIndex;
00206
00211 int32_t fEndIndex;
00212 };
00213
00214
inline FieldPosition&
00215 FieldPosition::operator=(
const FieldPosition& copy)
00216 {
00217 fField = copy.
fField;
00218 fEndIndex = copy.
fEndIndex;
00219 fBeginIndex = copy.
fBeginIndex;
00220
return *
this;
00221 }
00222
00223
inline UBool
00224 FieldPosition::operator==(
const FieldPosition& copy)
const
00225
{
00226
if( fField != copy.
fField ||
00227 fEndIndex != copy.
fEndIndex ||
00228 fBeginIndex != copy.
fBeginIndex)
00229
return FALSE;
00230
else
00231
return TRUE;
00232 }
00233
00234
inline UBool
00235 FieldPosition::operator!=(
const FieldPosition& copy)
const
00236
{
00237
return !
operator==(copy);
00238 }
00239
00240 U_NAMESPACE_END
00241
00242
#endif // _FIELDPOS
00243