Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: third_party/libaddressinput/chromium/cpp/src/address_field_util.cc

Issue 106763007: [rac] Parse postal code formats and required fields in libaddressinput. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Omit postal code examples and URL. Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698