6#ifndef MESSAGEFORMAT_DATA_MODEL_H
7#define MESSAGEFORMAT_DATA_MODEL_H
9#if U_SHOW_CPLUSPLUS_API
11#if !UCONFIG_NO_FORMATTING
16#include "unicode/messageformat2_data_model_names.h"
18#ifndef U_HIDE_DEPRECATED_API
37static inline std::vector<T> toStdVector(
const T* arr, int32_t len) {
38 std::vector<T> result;
39 for (int32_t i = 0; i < len; i++) {
40 result.push_back(arr[i]);
45#if defined(U_REAL_MSVC)
49#pragma warning(disable: 4251)
55 class MessageFormatter;
60 namespace data_model {
170 swap(
r1.bogus,
r2.bogus);
171 swap(
r1.parts,
r2.parts);
172 swap(
r1.len,
r2.len);
205 friend class Operator;
293 swap(
l1.thisIsQuoted,
l2.thisIsQuoted);
294 swap(
l1.contents,
l2.contents);
354 bool thisIsQuoted =
false;
366#if U_PF_WINDOWS <= U_PLATFORM && U_PLATFORM <= U_PF_CYGWIN
370#if defined(U_REAL_MSVC)
383#if U_PF_WINDOWS <= U_PLATFORM && U_PLATFORM <= U_PF_CYGWIN
384#if defined(U_REAL_MSVC) && defined(_MSVC_STL_VERSION)
386template class U_I18N_API std::_Variant_storage_<false, icu::UnicodeString, icu::message2::data_model::Literal>;
388template class U_I18N_API std::variant<icu::UnicodeString, icu::message2::data_model::Literal>;
389template class U_I18N_API std::optional<std::variant<icu::UnicodeString, icu::message2::data_model::Literal>>;
390template class U_I18N_API std::optional<icu::message2::data_model::Literal>;
397 namespace data_model {
423 UBool isVariable()
const;
432 UBool isLiteral()
const;
441 virtual UBool isNull()
const;
461 const Literal& asLiteral()
const;
479 explicit Operand(
const UnicodeString& v) : contents(VariableName(v)) {}
489 explicit Operand(
const Literal& l) : contents(l) {}
498 friend inline void swap(Operand& o1, Operand& o2)
noexcept {
502 swap(o1.contents, o2.contents);
510 virtual Operand& operator=(Operand)
noexcept;
517 Operand(
const Operand&);
526 std::optional<std::variant<VariableName, Literal>> contents;
554 UBool isWildcard()
const {
return !contents.has_value(); }
564 const Literal& asLiteral()
const;
571 Key(
const Key& other) : contents(other.contents) {}
579 Key() : contents(std::nullopt) {}
589 explicit Key(
const Literal& lit) : contents(lit) {}
598 friend inline void swap(Key& k1, Key& k2)
noexcept {
601 swap(k1.contents, k2.contents);
609 Key& operator=(Key)
noexcept;
623 bool operator<(
const Key& other)
const;
646 std::optional<Literal> contents;
657#if U_PF_WINDOWS <= U_PLATFORM && U_PLATFORM <= U_PF_CYGWIN
658template class U_I18N_API LocalPointerBase<message2::data_model::Key>;
659template class U_I18N_API LocalArray<message2::data_model::Key>;
664 namespace data_model {
675 class U_I18N_API SelectorKeys :
public UObject {
687 std::vector<Key> getKeys()
const {
688 return toStdVector<Key>(keys.getAlias(), len);
701 friend class SelectorKeys;
774 SelectorKeys() : len(0) {}
783 friend inline void swap(SelectorKeys&
s1, SelectorKeys&
s2)
noexcept {
786 swap(
s1.len,
s2.len);
787 swap(
s1.keys,
s2.keys);
795 SelectorKeys(
const SelectorKeys&
other);
802 SelectorKeys& operator=(SelectorKeys
other)
noexcept;
809 virtual ~SelectorKeys();
811 friend class Builder;
812 friend class message2::Checker;
814 friend class message2::Serializer;
819 const Key* getKeysInternal()
const;
827 namespace data_model {
888 swap(
o1.name,
o2.name);
889 swap(
o1.rand,
o2.rand);
925#if U_PF_WINDOWS <= U_PLATFORM && U_PLATFORM <= U_PF_CYGWIN
932 namespace data_model {
945 swap(
m1.bogus,
m2.bogus);
946 swap(
m1.options,
m2.options);
947 swap(
m1.len,
m2.len);
949 OptionMap() : len(0) {}
950 OptionMap(
const OptionMap&);
951 OptionMap& operator=(OptionMap);
952 std::vector<Option> getOptions()
const {
953 return toStdVector<Option>(options.getAlias(), len);
956 OptionMap(Option*, int32_t);
957 virtual ~OptionMap();
962 bool checkDuplicates =
true;
969 friend inline void swap(Builder& m1, Builder& m2)
noexcept {
972 swap(m1.options, m2.options);
973 swap(m1.checkDuplicates, m2.checkDuplicates);
976 Builder(
const Builder&) =
delete;
977 Builder& operator=(Builder)
noexcept;
981 friend class message2::Serializer;
984 LocalArray<Option> options;
993 friend inline void swap(Callable& c1, Callable& c2)
noexcept {
996 swap(c1.name, c2.name);
997 swap(c1.options, c2.options);
999 const FunctionName& getName()
const {
return name; }
1000 const OptionMap& getOptions()
const {
return options; }
1001 Callable(
const FunctionName& f,
const OptionMap& opts) : name(f), options(opts) {}
1002 Callable& operator=(Callable)
noexcept;
1003 Callable(
const Callable&);
1004 Callable() =
default;
1005 virtual ~Callable();
1022#if U_PF_WINDOWS <= U_PLATFORM && U_PLATFORM <= U_PF_CYGWIN
1023#if defined(U_REAL_MSVC) && defined(_MSVC_STL_VERSION)
1024template class U_I18N_API std::_Variant_storage_<false, icu::message2::data_model::Reserved,icu::message2::data_model::Callable>;
1026template class U_I18N_API std::variant<icu::message2::data_model::Reserved,icu::message2::data_model::Callable>;
1033 namespace data_model {
1059 UBool isReserved()
const {
return std::holds_alternative<Reserved>(contents); }
1069 const FunctionName& getFunctionName()
const;
1079 const Reserved& asReserved()
const;
1089 std::vector<Option> getOptions()
const {
1090 const Callable* f = std::get_if<Callable>(&contents);
1092 if (f ==
nullptr) {
return {}; }
1093 const OptionMap& opts = f->getOptions();
1094 return opts.getOptions();
1107 friend class Operator;
1108 bool isReservedSequence =
false;
1109 bool hasFunctionName =
false;
1110 bool hasOptions =
false;
1113 OptionMap::Builder options;
1200 Operator(
const Operator&
other)
noexcept;
1209 friend inline void swap(Operator&
o1, Operator&
o2)
noexcept {
1212 swap(
o1.contents,
o2.contents);
1220 Operator& operator=(Operator)
noexcept;
1228 Operator() : contents(
Reserved()) {}
1235 virtual ~Operator();
1237 friend class Binding;
1238 friend class Builder;
1239 friend class message2::Checker;
1241 friend class message2::Serializer;
1246 Operator(
const Reserved& r) : contents(r) {}
1248 const OptionMap& getOptionsInternal()
const;
1249 Operator(
const FunctionName&,
const OptionMap&);
1250 std::variant<Reserved, Callable> contents;
1263#if U_PF_WINDOWS <= U_PLATFORM && U_PLATFORM <= U_PF_CYGWIN
1264template class U_I18N_API std::optional<icu::message2::data_model::Operator>;
1265template class U_I18N_API std::optional<icu::message2::data_model::Reserved>;
1272 namespace data_model {
1274 typedef enum UMarkupType {
1337 std::vector<Option>
getOptions()
const {
return options.getOptions(); }
1376 OptionMap::Builder options;
1377 OptionMap::Builder attributes;
1378 UMarkupType type = UMARKUP_COUNT;
1484 friend class message2::Serializer;
1490 const OptionMap& getOptionsInternal()
const {
return options; }
1491 const OptionMap& getAttributesInternal()
const {
return attributes; }
1590 bool hasOperand =
false;
1591 bool hasOperator =
false;
1594 OptionMap::Builder attributes;
1679 swap(
e1.rator,
e2.rator);
1680 swap(
e1.rand,
e2.rand);
1681 swap(
e1.attributes,
e2.attributes);
1713 friend class message2::Serializer;
1732 std::optional<Operator> rator;
1735 const OptionMap& getAttributesInternal()
const {
return attributes; }
1746#if U_PF_WINDOWS <= U_PLATFORM && U_PLATFORM <= U_PF_CYGWIN
1747template class U_I18N_API LocalPointerBase<message2::data_model::Expression>;
1748template class U_I18N_API LocalArray<message2::data_model::Expression>;
1753 namespace data_model {
1799 if (expressionsLen <= 0 || !expressions.isValid()) {
1817 friend class message2::Parser;
1820 std::optional<Reserved> body;
1905 swap(
s1.keyword,
s2.keyword);
1906 swap(
s1.body,
s2.body);
1907 swap(
s1.expressions,
s2.expressions);
1908 swap(
s1.expressionsLen,
s2.expressionsLen);
1940 friend class message2::Serializer;
1943 std::optional<Reserved> body;
1975 UBool isText()
const {
return std::holds_alternative<UnicodeString>(piece); }
2035 swap(
p1.piece,
p2.piece);
2097 friend class Pattern;
2099 std::variant<UnicodeString, Expression, Markup> piece;
2110#if U_PF_WINDOWS <= U_PLATFORM && U_PLATFORM <= U_PF_CYGWIN
2119 namespace data_model {
2132 friend class PatternPart;
2145 Iterator begin()
const {
2146 return Iterator(
this, 0);
2157 Iterator end()
const {
2158 return Iterator(
this, len);
2171 friend class Pattern;
2261 friend inline void swap(Pattern&
p1, Pattern&
p2)
noexcept {
2264 swap(
p1.bogus,
p2.bogus);
2265 swap(
p1.len,
p2.len);
2266 swap(
p1.parts,
p2.parts);
2274 Pattern(
const Pattern&
other);
2281 Pattern& operator=(Pattern)
noexcept;
2301 using iterator_category = std::forward_iterator_tag;
2302 using difference_type = std::ptrdiff_t;
2303 using value_type = std::variant<UnicodeString, Expression, Markup>;
2304 using pointer = value_type*;
2305 using reference =
const value_type&;
2307 friend class Pattern;
2323 return patternContents(
part);
2342 friend class Builder;
2344 friend class message2::Serializer;
2357 static void initParts(Pattern&,
const Pattern&);
2382 static const std::variant<UnicodeString, Expression, Markup>&
2383 patternContents(
const PatternPart& p) {
return p.piece; }
2406 const Pattern& getPattern()
const {
return p; }
2415 const SelectorKeys& getKeys()
const {
return k; }
2427 Variant(
const SelectorKeys& keys, Pattern&& pattern) : k(keys), p(std::move(pattern)) {}
2436 friend inline void swap(Variant& v1, Variant& v2)
noexcept {
2448 Variant& operator=(Variant other)
noexcept;
2456 Variant() =
default;
2463 Variant(
const Variant&);
2477 namespace data_model {
2498 const Expression& getValue()
const;
2507 const VariableName& getVariable()
const {
return var; }
2522 static Binding input(UnicodeString&& variableName, Expression&& rhs,
UErrorCode& errorCode);
2530 UBool isLocal()
const {
return local; }
2540 Binding(
const VariableName& v, Expression&& e) : var(v), expr(std::move(e)), local(true), annotation(nullptr) {}
2549 friend inline void swap(Binding& b1, Binding& b2)
noexcept {
2552 swap(b1.var, b2.var);
2553 swap(b1.expr, b2.expr);
2554 swap(b1.local, b2.local);
2555 b1.updateAnnotation();
2556 b2.updateAnnotation();
2564 Binding(
const Binding& other);
2571 Binding& operator=(Binding)
noexcept;
2579 Binding() : local(true) {}
2588 friend class message2::Checker;
2589 friend class message2::MessageFormatter;
2590 friend class message2::Parser;
2591 friend class message2::Serializer;
2602 const Callable* annotation =
nullptr;
2604 const OptionMap& getOptionsInternal()
const;
2606 bool hasAnnotation()
const {
return !local && (annotation !=
nullptr); }
2607 void updateAnnotation();
2618#if U_PF_WINDOWS <= U_PLATFORM && U_PLATFORM <= U_PF_CYGWIN
2619template class U_I18N_API LocalPointerBase<message2::data_model::Variant>;
2620template class U_I18N_API LocalPointerBase<message2::data_model::Binding>;
2621template class U_I18N_API LocalArray<message2::data_model::Variant>;
2622template class U_I18N_API LocalArray<message2::data_model::Binding>;
2627 using namespace data_model;
2634 #ifndef U_IN_DOXYGEN
2635 class Matcher :
public UObject {
2637 Matcher& operator=(Matcher);
2638 Matcher(
const Matcher&);
2647 friend inline void swap(Matcher& m1, Matcher& m2)
noexcept {
2658 swap(m1.selectors, m2.selectors);
2659 swap(m1.numSelectors, m2.numSelectors);
2660 swap(m1.variants, m2.variants);
2661 swap(m1.numVariants, m2.numVariants);
2666 friend class MFDataModel;
2668 Matcher(Expression* ss, int32_t ns, Variant* vs, int32_t nv);
2677 LocalArray<Expression> selectors;
2679 int32_t numSelectors = 0;
2681 LocalArray<Variant> variants;
2683 int32_t numVariants = 0;
2696#if U_PF_WINDOWS <= U_PLATFORM && U_PLATFORM <= U_PF_CYGWIN
2697#if defined(U_REAL_MSVC) && defined(_MSVC_STL_VERSION)
2698template class U_I18N_API std::_Variant_storage_<false, icu::message2::Matcher,icu::message2::data_model::Pattern>;
2700template class U_I18N_API std::variant<icu::message2::Matcher,icu::message2::data_model::Pattern>;
2726 class U_I18N_API MFDataModel :
public UMemory {
2770 std::vector<Binding> getLocalVariables()
const {
2771 std::vector<Binding> result;
2773 return toStdVector<Binding>(bindings.getAlias(), bindingsLen);
2785 const std::vector<Expression> getSelectors()
const {
2786 if (std::holds_alternative<Pattern>(body)) {
2789 const Matcher* match = std::get_if<Matcher>(&body);
2791 return toStdVector<Expression>(match->selectors.getAlias(), match->numSelectors);
2801 std::vector<Variant> getVariants()
const {
2803 if (std::holds_alternative<Pattern>(body)) {
2806 const Matcher* match = std::get_if<Matcher>(&body);
2808 return toStdVector<Variant>(match->variants.getAlias(), match->numVariants);
2819 std::vector<UnsupportedStatement> getUnsupportedStatements()
const {
2820 std::vector<UnsupportedStatement> result;
2822 return toStdVector<UnsupportedStatement>(unsupportedStatements.getAlias(), unsupportedStatementsLen);
2835 const Pattern& getPattern()
const;
2862 friend inline void swap(MFDataModel& m1, MFDataModel& m2)
noexcept {
2873 swap(m1.body, m2.body);
2874 swap(m1.bindings, m2.bindings);
2875 swap(m1.bindingsLen, m2.bindingsLen);
2876 swap(m1.unsupportedStatements, m2.unsupportedStatements);
2877 swap(m1.unsupportedStatementsLen, m2.unsupportedStatementsLen);
2885 MFDataModel& operator=(MFDataModel)
noexcept;
2892 MFDataModel(
const MFDataModel& other);
2899 virtual ~MFDataModel();
2910 friend class MFDataModel;
2914 bool hasPattern =
true;
2915 bool hasSelectors =
false;
2921 UVector* unsupportedStatements =
nullptr;
3031 friend class Checker;
3033 friend class Serializer;
3037 bool hasPattern()
const {
return std::holds_alternative<Pattern>(body); }
3043 std::variant<Matcher, Pattern> body;
3053 int32_t unsupportedStatementsLen = 0;
3055 const Binding* getLocalVariablesInternal()
const;
3056 const Expression* getSelectorsInternal()
const;
3057 const Variant* getVariantsInternal()
const;
3060 int32_t numSelectors()
const {
3061 const Matcher* matcher = std::get_if<Matcher>(&body);
3062 return (matcher ==
nullptr ? 0 : matcher->numSelectors);
3065 const Matcher* matcher = std::get_if<Matcher>(&body);
3066 return (matcher ==
nullptr ? 0 : matcher->numVariants);
3070 void initBindings(
const Binding*);
3072 MFDataModel(
const Builder& builder,
UErrorCode&)
noexcept;
"Smart pointer" class, deletes objects via the C++ array delete[] operator.
"Smart pointer" base class; do not use directly: use LocalPointer etc.
T * getAlias() const
Access without ownership change.
UMemory is the common ICU base class.
UObject is the common ICU "boilerplate" class.
UnicodeString is a string class that stores Unicode characters directly and provides similar function...
The mutable MFDataModel::Builder class allows the data model to be constructed incrementally.
Builder(UErrorCode &status)
Default constructor.
Builder & addUnsupportedStatement(UnsupportedStatement &&s, UErrorCode &status)
Adds an unsupported statement.
Builder & addBinding(Binding &&b, UErrorCode &status)
Adds a binding, There must not already be a binding with the same name.
MFDataModel build(UErrorCode &status) const noexcept
Constructs a new immutable data model.
Builder & addVariant(SelectorKeys &&keys, Pattern &&pattern, UErrorCode &errorCode) noexcept
Adds a single variant.
Builder & addSelector(Expression &&selector, UErrorCode &errorCode) noexcept
Adds a selector expression.
Builder & setPattern(Pattern &&pattern)
Sets the body of the message as a pattern.
virtual ~Builder()
Destructor.
The mutable Expression::Builder class allows the operator to be constructed incrementally.
Builder & addAttribute(const UnicodeString &key, Operand &&value, UErrorCode &status)
Adds a single attribute.
Expression build(UErrorCode &status)
Constructs a new immutable Expression using the operand and operator that were previously set.
Builder & setOperand(Operand &&rAnd)
Sets the operand of this expression.
virtual ~Builder()
Destructor.
Builder & setOperator(Operator &&rAtor)
Sets the operator of this expression.
Builder(UErrorCode &status)
Default constructor.
The Expression class corresponds to the expression nonterminal in the MessageFormat 2 grammar and the...
const Operand & getOperand() const
Accesses the operand of this expression.
UBool isFunctionCall() const
Checks if this expression has a function annotation (with or without an operand).
Expression & operator=(Expression) noexcept
Assignment operator.
UBool isStandaloneAnnotation() const
Checks if this expression is an annotation with no operand.
UBool isReserved() const
Returns true if and only if this expression is annotated with a reserved sequence.
std::vector< Option > getAttributes() const
Gets the attributes of this expression.
virtual ~Expression()
Destructor.
Expression()
Default constructor.
Expression(const Expression &other)
Copy constructor.
const Operator * getOperator(UErrorCode &status) const
Accesses the function or reserved sequence annotating this expression.
friend void swap(Expression &e1, Expression &e2) noexcept
Non-member swap function.
The Literal class corresponds to the literal nonterminal in the MessageFormat 2 grammar,...
UBool isQuoted() const
Determines if this literal appeared as a quoted literal in the message.
const UnicodeString & unquoted() const
Returns the parsed string contents of this literal.
friend void swap(Literal &l1, Literal &l2) noexcept
Non-member swap function.
Literal(UBool q, const UnicodeString &s)
Literal constructor.
UnicodeString quoted() const
Returns the quoted representation of this literal (enclosed in '|' characters)
Literal()=default
Default constructor.
bool operator<(const Literal &other) const
Less than operator.
Literal(const Literal &other)
Copy constructor.
Literal & operator=(Literal) noexcept
Assignment operator.
bool operator==(const Literal &other) const
Equality operator.
virtual ~Literal()
Destructor.
The mutable Markup::Builder class allows the markup to be constructed incrementally.
Builder & setStandalone()
Sets this to be a standalone markup.
Builder & addOption(const UnicodeString &key, Operand &&value, UErrorCode &status)
Adds a single option.
Builder(UErrorCode &status)
Default constructor.
Builder & addAttribute(const UnicodeString &key, Operand &&value, UErrorCode &status)
Adds a single attribute.
Builder & setClose()
Sets this to be an closing markup.
virtual ~Builder()
Destructor.
Builder & setName(const UnicodeString &n)
Sets the name of this markup.
Markup build(UErrorCode &status)
Constructs a new immutable Markup using the name and type and (optionally) options and attributes tha...
Builder & setOpen()
Sets this to be an opening markup.
The Markup class corresponds to the markup nonterminal in the MessageFormat 2 grammar and the markup ...
Markup()
Default constructor.
std::vector< Option > getAttributes() const
Gets the attributes of this markup.
UBool isOpen() const
Checks if this markup is an opening tag.
std::vector< Option > getOptions() const
Gets the options of this markup.
UBool isClose() const
Checks if this markup is an closing tag.
virtual ~Markup()
Destructor.
const UnicodeString & getName() const
Gets the name of this markup.
UBool isStandalone() const
Checks if this markup is an standalone tag.
The mutable Operator::Builder class allows the operator to be constructed incrementally.
Builder & setFunctionName(FunctionName &&func)
Sets this operator to be a function annotation and sets its name to func.
Operator build(UErrorCode &status)
Constructs a new immutable Operator using the reserved annotation or the function name and options th...
Builder & addOption(const UnicodeString &key, Operand &&value, UErrorCode &status) noexcept
Sets this operator to be a function annotation and adds a single option.
Builder(UErrorCode &status)
Default constructor.
Builder & setReserved(Reserved &&reserved)
Sets this operator to be a reserved sequence.
virtual ~Builder()
Destructor.
An Option pairs an option name with an Operand.
Option(const Option &other)
Copy constructor.
virtual ~Option()
Destructor.
Option()
Default constructor.
Option & operator=(Option other) noexcept
Assignment operator.
Option(const UnicodeString &n, Operand &&r)
Constructor.
const UnicodeString & getName() const
Accesses the left-hand side of the option.
const Operand & getValue() const
Accesses the right-hand side of the option.
friend void swap(Option &o1, Option &o2) noexcept
Non-member swap function.
A PatternPart is a single element (text or expression) in a Pattern.
UBool isExpression() const
Checks if the part is an expression part.
PatternPart(const UnicodeString &t)
Text part constructor.
const Expression & contents() const
Accesses the expression of the part.
PatternPart(Expression &&e)
Expression part constructor.
const UnicodeString & asText() const
Accesses the text contents of the part.
PatternPart()=default
Default constructor.
PatternPart(Markup &&m)
Markup part constructor.
UBool isMarkup() const
Checks if the part is a markup part.
UBool isText() const
Checks if the part is a text part.
const Markup & asMarkup() const
Accesses the expression of the part.
PatternPart(const PatternPart &other)
Copy constructor.
PatternPart & operator=(PatternPart) noexcept
Assignment operator.
friend void swap(PatternPart &p1, PatternPart &p2) noexcept
Non-member swap function.
virtual ~PatternPart()
Destructor.
The mutable Pattern::Builder class allows the pattern to be constructed one part at a time.
Builder & add(UnicodeString &&part, UErrorCode &status) noexcept
Adds a single text part to the pattern.
virtual ~Builder()
Destructor.
Builder & add(Markup &&part, UErrorCode &status) noexcept
Adds a single markup part to the pattern.
Pattern build(UErrorCode &status) const noexcept
Constructs a new immutable Pattern using the list of parts set with previous add() calls.
Builder(UErrorCode &status)
Default constructor.
Builder & add(Expression &&part, UErrorCode &status) noexcept
Adds a single expression part to the pattern.
The mutable Reserved::Builder class allows the reserved sequence to be constructed one part at a time...
Reserved build(UErrorCode &status) const noexcept
Constructs a new immutable Reserved using the list of parts set with previous add() calls.
virtual ~Builder()
Destructor.
Builder & add(Literal &&part, UErrorCode &status) noexcept
Adds a single literal to the reserved sequence.
Builder(UErrorCode &status)
Default constructor.
The Reserved class represents a reserved annotation, as in the reserved nonterminal in the MessageFor...
Reserved & operator=(Reserved) noexcept
Assignment operator.
virtual ~Reserved()
Destructor.
int32_t numParts() const
A Reserved is a sequence of literals.
Reserved(const Reserved &other)
Copy constructor.
friend void swap(Reserved &r1, Reserved &r2) noexcept
Non-member swap function.
Reserved()
Default constructor.
const Literal & getPart(int32_t i) const
Indexes into the sequence.
The mutable SelectorKeys::Builder class allows the key list to be constructed one key at a time.
Builder & add(Key &&key, UErrorCode &status) noexcept
Adds a single key to the list.
virtual ~Builder()
Destructor.
Builder(UErrorCode &status)
Default constructor.
SelectorKeys build(UErrorCode &status) const
Constructs a new immutable SelectorKeys using the list of keys set with previous add() calls.
The mutable UnsupportedStatement::Builder class allows the statement to be constructed incrementally.
Builder & setKeyword(const UnicodeString &k)
Sets the keyword of this statement.
Builder(UErrorCode &status)
Default constructor.
Builder & addExpression(Expression &&e, UErrorCode &status)
Adds an expression to this statement.
virtual ~Builder()
Destructor.
UnsupportedStatement build(UErrorCode &status) const
Constructs a new immutable UnsupportedStatement using the keyword, body and (if applicable) expressio...
Builder & setBody(Reserved &&r)
Sets the body of this statement.
The UnsupportedStatement class corresponds to the reserved-statement nonterminal in the MessageFormat...
virtual ~UnsupportedStatement()
Destructor.
UnsupportedStatement & operator=(UnsupportedStatement) noexcept
Assignment operator.
const UnicodeString & getKeyword() const
Accesses the keyword of this statement.
const Reserved * getBody(UErrorCode &status) const
Accesses the reserved-body of this statement.
std::vector< Expression > getExpressions() const
Accesses the expressions of this statement.
friend void swap(UnsupportedStatement &s1, UnsupportedStatement &s2) noexcept
Non-member swap function.
UnsupportedStatement()
Default constructor.
UnsupportedStatement(const UnsupportedStatement &other)
Copy constructor.
C++ API: "Smart pointers" for use with and in ICU4C C++ code.
U_EXPORT UBool operator==(const StringPiece &x, const StringPiece &y)
Global operator == for StringPiece.
The Pattern::Iterator class provides an iterator over the formattable parts of a pattern.
reference operator*() const
Dereference operator (gets the element at the current iterator position)
Iterator operator++()
Increment operator (advances to the next iterator position)
int8_t UBool
The ICU boolean type, a signed-byte integer.
Basic definitions for ICU, for both C and C++ APIs.
UErrorCode
Standard ICU4C error code type, a substitute for exceptions.
#define U_I18N_API
Set to export library symbols from inside the i18n library, and to import them from outside.