ICU 4.8.1.1  4.8.1.1
format.h
Go to the documentation of this file.
00001 /*
00002 ********************************************************************************
00003 * Copyright (C) 1997-2010, International Business Machines Corporation and others.
00004 * All Rights Reserved.
00005 ********************************************************************************
00006 *
00007 * File FORMAT.H
00008 *
00009 * Modification History:
00010 *
00011 *   Date        Name        Description
00012 *   02/19/97    aliu        Converted from java.
00013 *   03/17/97    clhuang     Updated per C++ implementation.
00014 *   03/27/97    helena      Updated to pass the simple test after code review.
00015 ********************************************************************************
00016 */
00017 // *****************************************************************************
00018 // This file was generated from the java source file Format.java
00019 // *****************************************************************************
00020 
00021 #ifndef FORMAT_H
00022 #define FORMAT_H
00023 
00024 
00025 #include "unicode/utypes.h"
00026 
00032 #if !UCONFIG_NO_FORMATTING
00033 
00034 #include "unicode/unistr.h"
00035 #include "unicode/fmtable.h"
00036 #include "unicode/fieldpos.h"
00037 #include "unicode/fpositer.h"
00038 #include "unicode/parsepos.h"
00039 #include "unicode/parseerr.h" 
00040 #include "unicode/locid.h"
00041 
00042 U_NAMESPACE_BEGIN
00043 
00094 class U_I18N_API Format : public UObject {
00095 public:
00096 
00100     virtual ~Format();
00101 
00110     virtual UBool operator==(const Format& other) const = 0;
00111 
00119     UBool operator!=(const Format& other) const { return !operator==(other); }
00120 
00127     virtual Format* clone() const = 0;
00128 
00139     UnicodeString& format(const Formattable& obj,
00140                           UnicodeString& appendTo,
00141                           UErrorCode& status) const;
00142 
00159     virtual UnicodeString& format(const Formattable& obj,
00160                                   UnicodeString& appendTo,
00161                                   FieldPosition& pos,
00162                                   UErrorCode& status) const = 0;
00179     virtual UnicodeString& format(const Formattable& obj,
00180                                   UnicodeString& appendTo,
00181                                   FieldPositionIterator* posIter,
00182                                   UErrorCode& status) const;
00183 
00223     virtual void parseObject(const UnicodeString& source,
00224                              Formattable& result,
00225                              ParsePosition& parse_pos) const = 0;
00226 
00239     void parseObject(const UnicodeString& source,
00240                      Formattable& result,
00241                      UErrorCode& status) const;
00242 
00249     Locale getLocale(ULocDataLocaleType type, UErrorCode& status) const;
00250 
00257     const char* getLocaleID(ULocDataLocaleType type, UErrorCode &status) const;
00258 
00259  protected:
00261     void setLocaleIDs(const char* valid, const char* actual);
00262 
00263 protected:
00268     Format();
00269 
00273     Format(const Format&); // Does nothing; for subclasses only
00274 
00278     Format& operator=(const Format&); // Does nothing; for subclasses
00279 
00280        
00289     static void syntaxError(const UnicodeString& pattern,
00290                             int32_t pos,
00291                             UParseError& parseError);
00292 
00293  private:
00294     char actualLocale[ULOC_FULLNAME_CAPACITY];
00295     char validLocale[ULOC_FULLNAME_CAPACITY];
00296 };
00297 
00298 U_NAMESPACE_END
00299 
00300 #endif /* #if !UCONFIG_NO_FORMATTING */
00301 
00302 #endif // _FORMAT
00303 //eof
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines