- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

# 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
    00255     virtual UClassID getDynamicClassID() const = 0;
    00256
    00263     Locale getLocale(ULocDataLocaleType type, UErrorCode& status) const;
    00264
    00271     const char* getLocaleID(ULocDataLocaleType type, UErrorCode &status) const;
    00272
    00273  protected:
    00275     void setLocaleIDs(const char* valid, const char* actual);
    00276
    00277 protected:
    00282     Format();
    00283
    00287     Format(const Format&); // Does nothing; for subclasses only
    00288
    00292     Format& operator=(const Format&); // Does nothing; for subclasses
    00293
    00294
    00303     static void syntaxError(const UnicodeString& pattern,
    00304                             int32_t pos,
    00305                             UParseError& parseError);
    00306
    00307  private:
    00308     char actualLocale[ULOC_FULLNAME_CAPACITY];
    00309     char validLocale[ULOC_FULLNAME_CAPACITY];
    00310 };
    00311
    00312 U_NAMESPACE_END
    00313
    00314 #endif /* #if !UCONFIG_NO_FORMATTING */
    00315
    00316 #endif // _FORMAT
    00317 //eof

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines