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

Unified Diff: third_party/libaddressinput/chromium/cpp/src/lookup_key.h

Issue 116363003: [rac] Validate an address. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: third_party/libaddressinput/chromium/cpp/src/lookup_key.h
diff --git a/third_party/libaddressinput/chromium/cpp/src/lookup_key.h b/third_party/libaddressinput/chromium/cpp/src/lookup_key.h
index 23e8e29c8a4faa1bdce79f44267124a579685069..d6aa2219278161c9dd11ab8ae4764468aad5539f 100644
--- a/third_party/libaddressinput/chromium/cpp/src/lookup_key.h
+++ b/third_party/libaddressinput/chromium/cpp/src/lookup_key.h
@@ -45,6 +45,7 @@ namespace i18n {
namespace addressinput {
class Rule;
+struct AddressData;
// Stores a parsed validation rule, its identifier, and its level. Sample usage:
// LookupKey country_key("CA");
@@ -98,11 +99,18 @@ class LookupKey {
// Returns the lookup key for |sub_region| or NULL. The caller does not own
Evan Stade 2013/12/19 02:12:38 explain when it may return NULL
please use gerrit instead 2014/01/08 00:55:52 Done.
// the result.
- LookupKey* GetSubKey(const std::string& sub_key) const;
+ const LookupKey* GetSubKey(const std::string& sub_region) const;
// Returns the lookup key for |language_code| or NULL. The caller does not own
Evan Stade 2013/12/19 02:12:38 explain when it may return NULL
please use gerrit instead 2014/01/08 00:55:52 Done.
// the result.
- LookupKey* GetLanguageCodeKey(const std::string& language_code) const;
+ const LookupKey* GetLanguageCodeKey(const std::string& language_code) const;
+
+ // Builds a mapping of address fields to corresponding parsed validation rules
+ // for |address|. The caller does not own the returned Rule objects. For
+ // example, if the address is "Calgary, Alberta, Canada" with "fr" language
+ // code, then returns the rules for "data/CA--fr" and "data/CA/AB--fr".
+ std::map<AddressField, const Rule*> BuildFieldRuleMap(
+ const AddressData& address) const;
private:
// A mapping of string identifiers to LookupKey objects. A string identifier

Powered by Google App Engine
This is Rietveld 408576698