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/utypes.h"
00022
00023 #if U_SHOW_CPLUSPLUS_API
00024
00025 #include "unicode/messagepattern.h"
00026 #include "unicode/numfmt.h"
00027
00033 #if !UCONFIG_NO_FORMATTING
00034
00035 U_NAMESPACE_BEGIN
00036
00037 class MessageFormat;
00038
00188 class U_I18N_API SelectFormat : public Format {
00189 public:
00190
00199 SelectFormat(const UnicodeString& pattern, UErrorCode& status);
00200
00205 SelectFormat(const SelectFormat& other);
00206
00211 virtual ~SelectFormat();
00212
00224 void applyPattern(const UnicodeString& pattern, UErrorCode& status);
00225
00226
00227 using Format::format;
00228
00242 UnicodeString& format(const UnicodeString& keyword,
00243 UnicodeString& appendTo,
00244 FieldPosition& pos,
00245 UErrorCode& status) const;
00246
00253 SelectFormat& operator=(const SelectFormat& other);
00254
00262 virtual UBool operator==(const Format& other) const;
00263
00271 virtual UBool operator!=(const Format& other) const;
00272
00278 virtual SelectFormat* clone() const;
00279
00295 UnicodeString& format(const Formattable& obj,
00296 UnicodeString& appendTo,
00297 FieldPosition& pos,
00298 UErrorCode& status) const;
00299
00308 UnicodeString& toPattern(UnicodeString& appendTo);
00309
00332 virtual void parseObject(const UnicodeString& source,
00333 Formattable& result,
00334 ParsePosition& parse_pos) const;
00335
00340 static UClassID U_EXPORT2 getStaticClassID(void);
00341
00346 virtual UClassID getDynamicClassID() const;
00347
00348 private:
00349 friend class MessageFormat;
00350
00351 SelectFormat();
00352
00361 static int32_t findSubMessage(const MessagePattern& pattern, int32_t partIndex,
00362 const UnicodeString& keyword, UErrorCode& ec);
00363
00364 MessagePattern msgPattern;
00365 };
00366
00367 U_NAMESPACE_END
00368
00369 #endif
00370
00371 #endif
00372
00373 #endif // _SELFMT
00374