Main Page   Class Hierarchy   Compound List   File List   Header Files   Sources   Compound Members   File Members  

fieldpos.h

00001 /*
00002 ********************************************************************************
00003 *   Copyright (C) 1997-1999, International Business Machines
00004 *   Corporation and others.  All Rights Reserved.
00005 ********************************************************************************
00006 *
00007 * File FIELDPOS.H
00008 *
00009 * Modification History:
00010 *
00011 *   Date        Name        Description
00012 *   02/25/97    aliu        Converted from java.
00013 *   03/17/97    clhuang     Updated per Format implementation.
00014 *    07/17/98    stephen        Added default/copy ctors, and operators =, ==, !=
00015 ********************************************************************************
00016 */
00017 // *****************************************************************************
00018 // This file was generated from the java source file FieldPosition.java
00019 // *****************************************************************************
00020  
00021 #ifndef FIELDPOS_H
00022 #define FIELDPOS_H
00023 
00024 #include "unicode/utypes.h"
00025 
00088 class U_I18N_API FieldPosition {
00089 public:
00094     enum { DONT_CARE = -1 };
00095 
00100     FieldPosition() 
00101         : fField(DONT_CARE), fBeginIndex(0), fEndIndex(0) {}
00102 
00114     FieldPosition(int32_t field) 
00115         : fField(field), fBeginIndex(0), fEndIndex(0) {}
00116 
00122     FieldPosition(const FieldPosition& copy) 
00123         : fField(copy.fField), fBeginIndex(copy.fBeginIndex), fEndIndex(copy.fEndIndex) {}
00124 
00129     ~FieldPosition() {}
00130 
00135     FieldPosition&      operator=(const FieldPosition& copy);
00136 
00142     UBool              operator==(const FieldPosition& that) const;
00143 
00149     UBool              operator!=(const FieldPosition& that) const;
00150 
00155     int32_t getField(void) const { return fField; }
00156 
00161     int32_t getBeginIndex(void) const { return fBeginIndex; }
00162 
00168     int32_t getEndIndex(void) const { return fEndIndex; }
00169  
00174     void setField(int32_t f) { fField = f; }
00175 
00180     void setBeginIndex(int32_t bi) { fBeginIndex = bi; }
00181 
00186     void setEndIndex(int32_t ei) { fEndIndex = ei; }
00187     
00188 private:
00193     int32_t fField;
00194 
00199     int32_t fBeginIndex;
00200 
00205     int32_t fEndIndex;
00206 };
00207 
00208 inline FieldPosition&
00209 FieldPosition::operator=(const FieldPosition& copy)
00210 {
00211     fField         = copy.fField;
00212     fEndIndex     = copy.fEndIndex;
00213     fBeginIndex = copy.fBeginIndex;
00214     return *this;
00215 }
00216 
00217 inline UBool
00218 FieldPosition::operator==(const FieldPosition& copy) const
00219 {
00220     if(    fField         != copy.fField || 
00221         fEndIndex     != copy.fEndIndex ||
00222         fBeginIndex != copy.fBeginIndex) 
00223         return FALSE;
00224     else
00225         return TRUE;
00226 }
00227 
00228 inline UBool
00229 FieldPosition::operator!=(const FieldPosition& copy) const
00230 {
00231     return !operator==(copy);
00232 }
00233 
00234 #endif // _FIELDPOS
00235 //eof

Generated at Wed Aug 16 16:05:33 2000 for ICU1.6 by doxygen 1.0.0 written by Dimitri van Heesch, © 1997-1999