00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
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/uobject.h"
00029
#include "unicode/unistr.h"
00030
#include "unicode/fmtable.h"
00031
#include "unicode/fieldpos.h"
00032
#include "unicode/parsepos.h"
00033
#include "unicode/parseerr.h"
00034
#include "unicode/locid.h"
00035
00036
U_NAMESPACE_BEGIN
00037
00038
class ResourceBundle;
00039
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;
00163
00203 virtual
void parseObject(const
UnicodeString& source,
00204
Formattable& result,
00205
ParsePosition& parse_pos) const = 0;
00206
00219
void parseObject(const
UnicodeString& source,
00220
Formattable& result,
00221 UErrorCode& status) const;
00222
00235 virtual UClassID getDynamicClassID() const = 0;
00236
00243
Locale getLocale(ULocDataLocaleType type, UErrorCode& status) const;
00244
00251 const
char* getLocaleID(ULocDataLocaleType type, UErrorCode &status) const;
00252
00253 protected:
00254
00255
void setLocales(const
ResourceBundle& res);
00256
00257
void setLocaleIDs(const
char* valid, const
char* actual);
00258
00259 protected:
00264 Format();
00265
00269 Format(const Format&);
00270
00274 Format& operator=(const Format&);
00275
00276
00285 static
void syntaxError(const
UnicodeString& pattern,
00286 int32_t pos,
00287
UParseError& parseError);
00288
00289 private:
00290
char actualLocale[ULOC_FULLNAME_CAPACITY];
00291
char validLocale[ULOC_FULLNAME_CAPACITY];
00292 };
00293
00294 U_NAMESPACE_END
00295
00296 #endif
00297
00298 #endif
00299