| Index: third_party/libaddressinput/chromium/cpp/src/rule.h
|
| diff --git a/third_party/libaddressinput/chromium/cpp/src/rule.h b/third_party/libaddressinput/chromium/cpp/src/rule.h
|
| index 9e6fa098405f8971d5c3dcec6842ae86cd7f8b97..825f5a0c81a0702afcb952c146feb4a6529f9b2f 100644
|
| --- a/third_party/libaddressinput/chromium/cpp/src/rule.h
|
| +++ b/third_party/libaddressinput/chromium/cpp/src/rule.h
|
| @@ -26,6 +26,23 @@
|
| namespace i18n {
|
| namespace addressinput {
|
|
|
| +struct FormatElement {
|
| + enum Type {
|
| + FIELD,
|
| + LITERAL
|
| + };
|
| +
|
| + explicit FormatElement(AddressField field);
|
| + explicit FormatElement(const std::string& literal);
|
| + ~FormatElement();
|
| +
|
| + bool operator==(const FormatElement& other) const;
|
| +
|
| + Type type;
|
| + AddressField field;
|
| + std::string literal;
|
| +};
|
| +
|
| // Stores the validation rules. Sample usage:
|
| // Rule rule;
|
| // if (rule.ParseSerializedRule("{\"fmt\": \"%A%n%C%S %Z\"}")) {
|
| @@ -49,7 +66,7 @@ class Rule {
|
| bool ParseSerializedRule(const std::string& serialized_rule);
|
|
|
| // Returns the address format for this rule.
|
| - const std::vector<std::vector<AddressField> >& GetFormat() const {
|
| + const std::vector<std::vector<FormatElement> >& GetFormat() const {
|
| return format_;
|
| }
|
|
|
| @@ -98,7 +115,7 @@ class Rule {
|
| int GetInvalidFieldMessageId(AddressField field) const;
|
|
|
| private:
|
| - std::vector<std::vector<AddressField> > format_;
|
| + std::vector<std::vector<FormatElement> > format_;
|
| std::vector<AddressField> required_;
|
| std::vector<std::string> sub_keys_;
|
| std::vector<std::string> languages_;
|
|
|