format.h

00001 /*
00002 ********************************************************************************
00003 * Copyright (C) {1997-2004}, 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 
00026 #if !UCONFIG_NO_FORMATTING
00027 
00028 #include "unicode/unistr.h"
00029 #include "unicode/fmtable.h"
00030 #include "unicode/fieldpos.h"
00031 #include "unicode/parsepos.h"
00032 #include "unicode/parseerr.h" 
00033 #include "unicode/locid.h"
00034 
00035 U_NAMESPACE_BEGIN
00036 
00087 class U_I18N_API Format : public UObject {
00088 public:
00089 
00093     virtual ~Format();
00094 
00103     virtual UBool operator==(const Format& other) const = 0;
00104 
00112     UBool operator!=(const Format& other) const { return !operator==(other); }
00113 
00120     virtual Format* clone() const = 0;
00121 
00132     UnicodeString& format(const Formattable& obj,
00133                           UnicodeString& appendTo,
00134                           UErrorCode& status) const;
00135 
00152     virtual UnicodeString& format(const Formattable& obj,
00153                                   UnicodeString& appendTo,
00154                                   FieldPosition& pos,
00155                                   UErrorCode& status) const = 0;
00156 
00196     virtual void parseObject(const UnicodeString& source,
00197                              Formattable& result,
00198                              ParsePosition& parse_pos) const = 0;
00199 
00212     void parseObject(const UnicodeString& source,
00213                      Formattable& result,
00214                      UErrorCode& status) const;
00215 
00228     virtual UClassID getDynamicClassID() const = 0;
00229 
00236     Locale getLocale(ULocDataLocaleType type, UErrorCode& status) const;
00237 
00244     const char* getLocaleID(ULocDataLocaleType type, UErrorCode &status) const;
00245 
00246  protected:
00248     void setLocaleIDs(const char* valid, const char* actual);
00249 
00250 protected:
00255     Format();
00256 
00260     Format(const Format&); // Does nothing; for subclasses only
00261 
00265     Format& operator=(const Format&); // Does nothing; for subclasses
00266 
00267        
00276     static void syntaxError(const UnicodeString& pattern,
00277                             int32_t pos,
00278                             UParseError& parseError);
00279 
00280  private:
00281     char actualLocale[ULOC_FULLNAME_CAPACITY];
00282     char validLocale[ULOC_FULLNAME_CAPACITY];
00283 };
00284 
00285 U_NAMESPACE_END
00286 
00287 #endif /* #if !UCONFIG_NO_FORMATTING */
00288 
00289 #endif // _FORMAT
00290 //eof

Generated on Tue Nov 16 10:03:05 2004 for ICU 3.2 by  doxygen 1.3.9.1