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
00090 class U_I18N_API Format :
public UObject {
00091
public:
00092
00096
virtual ~Format();
00097
00106
virtual UBool operator==(
const Format& other)
const = 0;
00107
00115
UBool operator!=(
const Format& other)
const {
return !operator==(other); }
00116
00123
virtual Format* clone()
const = 0;
00124
00135
UnicodeString& format(
const Formattable& obj,
00136
UnicodeString& appendTo,
00137
UErrorCode& status)
const;
00138
00155
virtual UnicodeString& format(
const Formattable& obj,
00156
UnicodeString& appendTo,
00157
FieldPosition& pos,
00158
UErrorCode& status)
const = 0;
00159
00199
virtual void parseObject(
const UnicodeString& source,
00200
Formattable& result,
00201
ParsePosition& parse_pos)
const = 0;
00202
00215
void parseObject(
const UnicodeString& source,
00216
Formattable& result,
00217
UErrorCode& status)
const;
00218
00231
virtual UClassID getDynamicClassID()
const = 0;
00232
00239
Locale getLocale(
ULocDataLocaleType type,
UErrorCode& status)
const;
00240
00247
const char* getLocaleID(
ULocDataLocaleType type,
UErrorCode &status)
const;
00248
00249
protected:
00251
void setLocales(
const ResourceBundle& res);
00252
00254
void setLocaleIDs(
const char* valid,
const char* actual);
00255
00256
protected:
00261 Format();
00262
00266 Format(
const Format&);
00267
00271 Format& operator=(
const Format&);
00272
00273
00282
static void syntaxError(
const UnicodeString& pattern,
00283
int32_t pos,
00284
UParseError& parseError);
00285
00286
private:
00287
char actualLocale[
ULOC_FULLNAME_CAPACITY];
00288
char validLocale[
ULOC_FULLNAME_CAPACITY];
00289 };
00290
00291
U_NAMESPACE_END
00292
00293
#endif
00294
00295
#endif // _FORMAT
00296