ICU 56.1: selfmt.h Source File

ICU 56.1 56.1

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

- File List
- Globals

selfmt.h
Go to the documentation of this file.
1 /********************************************************************
2 * COPYRIGHT:
3 * Copyright (c) 1997-2011, International Business Machines Corporation and
4 * others. All Rights Reserved.
5 * Copyright (C) 2010 , Yahoo! Inc.
6 ********************************************************************
7 *
8 * File SELFMT.H
9 *
10 * Modification History:
11 *
12 * Date Name Description
13 * 11/11/09 kirtig Finished first cut of implementation.
14 ********************************************************************/
15
16 #ifndef SELFMT
17 #define SELFMT
18
19 #include "unicode/messagepattern.h"
20 #include "unicode/numfmt.h"
21 #include "unicode/utypes.h"
22
28 #if !UCONFIG_NO_FORMATTING
29
30 U_NAMESPACE_BEGIN
31
32 class MessageFormat;
33
183 class U_I18N_API SelectFormat : public Format {
184 public:
185
194 SelectFormat(const UnicodeString& pattern, UErrorCode& status);
195
200 SelectFormat(const SelectFormat& other);
201
206 virtual ~SelectFormat();
207
219 void applyPattern(const UnicodeString& pattern, UErrorCode& status);
220
221
222 using Format::format;
223
237 UnicodeString& format(const UnicodeString& keyword,
238 UnicodeString& appendTo,
239 FieldPosition& pos,
240 UErrorCode& status) const;
241
248 SelectFormat& operator=(const SelectFormat& other);
249
257 virtual UBool operator==(const Format& other) const;
258
266 virtual UBool operator!=(const Format& other) const;
267
273 virtual Format* clone(void) const;
274
290 UnicodeString& format(const Formattable& obj,
291 UnicodeString& appendTo,
292 FieldPosition& pos,
293 UErrorCode& status) const;
294
303 UnicodeString& toPattern(UnicodeString& appendTo);
304
327 virtual void parseObject(const UnicodeString& source,
328 Formattable& result,
329 ParsePosition& parse_pos) const;
330
335 static UClassID U_EXPORT2 getStaticClassID(void);
336
341 virtual UClassID getDynamicClassID() const;
342
343 private:
344 friend class MessageFormat;
345
346 SelectFormat(); // default constructor not implemented.
347
356 static int32_t findSubMessage(const MessagePattern& pattern, int32_t partIndex,
357 const UnicodeString& keyword, UErrorCode& ec);
358
359 MessagePattern msgPattern;
360 };
361
362 U_NAMESPACE_END
363
364 #endif /* #if !UCONFIG_NO_FORMATTING */
365
366 #endif // _SELFMT
367 //eof
icu::Format
Base class for all formats.
Definition: format.h:94
icu::UObject::getDynamicClassID
virtual UClassID getDynamicClassID() const
ICU4C "poor man's RTTI", returns a UClassID for the actual ICU class.
UClassID
void * UClassID
UClassID is used to identify classes without using the compiler's RTTI.
Definition: uobject.h:91
icu::MessagePattern
Parses and represents ICU MessageFormat patterns.
Definition: messagepattern.h:358
U_I18N_API
#define U_I18N_API
Set to export library symbols from inside the i18n library, and to import them from outside...
Definition: utypes.h:358
U_NAMESPACE_BEGIN
#define U_NAMESPACE_BEGIN
This is used to begin a declaration of a public ICU C++ API.
Definition: uversion.h:129
icu::Format::format
UnicodeString & format(const Formattable &obj, UnicodeString &appendTo, UErrorCode &status) const
Formats an object to produce a string.
icu::MessageFormat
Definition: msgfmt.h:323
U_NAMESPACE_END
#define U_NAMESPACE_END
This is used to end a declaration of a public ICU C++ API.
Definition: uversion.h:130
icu::Format::parseObject
virtual void parseObject(const UnicodeString &source, Formattable &result, ParsePosition &parse_pos) const =0
Parse a string to produce an object.
icu::Format::operator==
virtual UBool operator==(const Format &other) const =0
Return true if the given Format objects are semantically equal.
icu::SelectFormat
Definition: selfmt.h:183
UErrorCode
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers...
Definition: utypes.h:476
icu::FieldPosition
FieldPosition is a simple class used by Format and its subclasses to identify fields in formatted out...
Definition: fieldpos.h:106
icu::ParsePosition
ParsePosition is a simple class used by Format and its subclasses to keep track of the current positi...
Definition: parsepos.h:47
utypes.h
Basic definitions for ICU, for both C and C++ APIs.
icu::Format::operator=
Format & operator=(const Format &)
icu::Format::operator!=
UBool operator!=(const Format &other) const
Return true if the given Format objects are not semantically equal.
Definition: format.h:119
icu::UnicodeString
UnicodeString is a string class that stores Unicode characters directly and provides similar function...
Definition: unistr.h:293
icu::Formattable
Formattable objects can be passed to the Format class or its subclasses for formatting.
Definition: fmtable.h:66
messagepattern.h
C++ API: MessagePattern class: Parses and represents ICU MessageFormat patterns.
numfmt.h
C++ API: Abstract base class for all number formats.
icu::Format::clone
virtual Format * clone() const =0
Clone this object polymorphically.
UBool
int8_t UBool
The ICU boolean type.
Definition: umachine.h:234