00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef SELFMT
00019 #define SELFMT
00020
00021 #include "unicode/messagepattern.h"
00022 #include "unicode/numfmt.h"
00023 #include "unicode/utypes.h"
00024
00030 #if !UCONFIG_NO_FORMATTING
00031
00032 U_NAMESPACE_BEGIN
00033
00034 class MessageFormat;
00035
00185 class U_I18N_API SelectFormat : public Format {
00186 public:
00187
00196 SelectFormat(const UnicodeString& pattern, UErrorCode& status);
00197
00202 SelectFormat(const SelectFormat& other);
00203
00208 virtual ~SelectFormat();
00209
00221 void applyPattern(const UnicodeString& pattern, UErrorCode& status);
00222
00223
00224 using Format::format;
00225
00239 UnicodeString& format(const UnicodeString& keyword,
00240 UnicodeString& appendTo,
00241 FieldPosition& pos,
00242 UErrorCode& status) const;
00243
00250 SelectFormat& operator=(const SelectFormat& other);
00251
00259 virtual UBool operator==(const Format& other) const;
00260
00268 virtual UBool operator!=(const Format& other) const;
00269
00275 virtual Format* clone(void) const;
00276
00292 UnicodeString& format(const Formattable& obj,
00293 UnicodeString& appendTo,
00294 FieldPosition& pos,
00295 UErrorCode& status) const;
00296
00305 UnicodeString& toPattern(UnicodeString& appendTo);
00306
00329 virtual void parseObject(const UnicodeString& source,
00330 Formattable& result,
00331 ParsePosition& parse_pos) const;
00332
00337 static UClassID U_EXPORT2 getStaticClassID(void);
00338
00343 virtual UClassID getDynamicClassID() const;
00344
00345 private:
00346 friend class MessageFormat;
00347
00348 SelectFormat();
00349
00358 static int32_t findSubMessage(const MessagePattern& pattern, int32_t partIndex,
00359 const UnicodeString& keyword, UErrorCode& ec);
00360
00361 MessagePattern msgPattern;
00362 };
00363
00364 U_NAMESPACE_END
00365
00366 #endif
00367
00368 #endif // _SELFMT
00369