OLD | NEW |
1 // Copyright (C) 2013 Google Inc. | 1 // Copyright (C) 2013 Google Inc. |
2 // | 2 // |
3 // Licensed under the Apache License, Version 2.0 (the "License"); | 3 // Licensed under the Apache License, Version 2.0 (the "License"); |
4 // you may not use this file except in compliance with the License. | 4 // you may not use this file except in compliance with the License. |
5 // You may obtain a copy of the License at | 5 // You may obtain a copy of the License at |
6 // | 6 // |
7 // http://www.apache.org/licenses/LICENSE-2.0 | 7 // http://www.apache.org/licenses/LICENSE-2.0 |
8 // | 8 // |
9 // Unless required by applicable law or agreed to in writing, software | 9 // Unless required by applicable law or agreed to in writing, software |
10 // distributed under the License is distributed on an "AS IS" BASIS, | 10 // distributed under the License is distributed on an "AS IS" BASIS, |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 for (std::string::const_iterator current = format.begin(), | 73 for (std::string::const_iterator current = format.begin(), |
74 next = format.begin() + 1; | 74 next = format.begin() + 1; |
75 current != format.end() && next != format.end(); | 75 current != format.end() && next != format.end(); |
76 ++current, ++next) { | 76 ++current, ++next) { |
77 if (IsTokenPrefix(*current) && IsToken(*next)) { | 77 if (IsTokenPrefix(*current) && IsToken(*next)) { |
78 fields->push_back(ParseToken(*next)); | 78 fields->push_back(ParseToken(*next)); |
79 } | 79 } |
80 } | 80 } |
81 } | 81 } |
82 | 82 |
| 83 void ParseAddressFieldsRequired(const std::string& required, |
| 84 std::vector<AddressField>* fields) { |
| 85 assert(fields != NULL); |
| 86 fields->clear(); |
| 87 for (std::string::const_iterator token = required.begin(); |
| 88 token != required.end(); ++token) { |
| 89 if (IsToken(*token)) { |
| 90 fields->push_back(ParseToken(*token)); |
| 91 } |
| 92 } |
| 93 } |
| 94 |
83 } // namespace addressinput | 95 } // namespace addressinput |
84 } // namespace i18n | 96 } // namespace i18n |
OLD | NEW |