format.h

Go to the documentation of this file.
00001 /*
00002 ********************************************************************************
00003 * Copyright (C) {1997-2005}, International Business Machines Corporation and others. All Rights Reserved.
00004 ********************************************************************************
00005 *
00006 * File FORMAT.H
00007 *
00008 * Modification History:
00009 *
00010 *   Date        Name        Description
00011 *   02/19/97    aliu        Converted from java.
00012 *   03/17/97    clhuang     Updated per C++ implementation.
00013 *   03/27/97    helena      Updated to pass the simple test after code review.
00014 ********************************************************************************
00015 */
00016 // *****************************************************************************
00017 // This file was generated from the java source file Format.java
00018 // *****************************************************************************
00019 
00020 #ifndef FORMAT_H
00021 #define FORMAT_H
00022 
00023 
00024 #include "unicode/utypes.h"
00025 
00031 #if !UCONFIG_NO_FORMATTING
00032 
00033 #include "unicode/unistr.h"
00034 #include "unicode/fmtable.h"
00035 #include "unicode/fieldpos.h"
00036 #include "unicode/parsepos.h"
00037 #include "unicode/parseerr.h" 
00038 #include "unicode/locid.h"
00039 
00040 U_NAMESPACE_BEGIN
00041 
00092 class U_I18N_API Format : public UObject {
00093 public:
00094 
00098     virtual ~Format();
00099 
00108     virtual UBool operator==(const Format& other) const = 0;
00109 
00117     UBool operator!=(const Format& other) const { return !operator==(other); }
00118 
00125     virtual Format* clone() const = 0;
00126 
00137     UnicodeString& format(const Formattable& obj,
00138                           UnicodeString& appendTo,
00139                           UErrorCode& status) const;
00140 
00157     virtual UnicodeString& format(const Formattable& obj,
00158                                   UnicodeString& appendTo,
00159                                   FieldPosition& pos,
00160                                   UErrorCode& status) const = 0;
00161 
00201     virtual void parseObject(const UnicodeString& source,
00202                              Formattable& result,
00203                              ParsePosition& parse_pos) const = 0;
00204 
00217     void parseObject(const UnicodeString& source,
00218                      Formattable& result,
00219                      UErrorCode& status) const;
00220 
00233     virtual UClassID getDynamicClassID() const = 0;
00234 
00241     Locale getLocale(ULocDataLocaleType type, UErrorCode& status) const;
00242 
00249     const char* getLocaleID(ULocDataLocaleType type, UErrorCode &status) const;
00250 
00251  protected:
00253     void setLocaleIDs(const char* valid, const char* actual);
00254 
00255 protected:
00260     Format();
00261 
00265     Format(const Format&); // Does nothing; for subclasses only
00266 
00270     Format& operator=(const Format&); // Does nothing; for subclasses
00271 
00272        
00281     static void syntaxError(const UnicodeString& pattern,
00282                             int32_t pos,
00283                             UParseError& parseError);
00284 
00285  private:
00286     char actualLocale[ULOC_FULLNAME_CAPACITY];
00287     char validLocale[ULOC_FULLNAME_CAPACITY];
00288 };
00289 
00290 U_NAMESPACE_END
00291 
00292 #endif /* #if !UCONFIG_NO_FORMATTING */
00293 
00294 #endif // _FORMAT
00295 //eof

Generated on Tue Feb 28 01:37:39 2006 for ICU 3.4 by  doxygen 1.4.4