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

Side by Side Diff: third_party/libaddressinput/chromium/cpp/src/util/json.h

Issue 140823005: [rac] Download country code data in a single HTTP request. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Temporarily switch to staging URL. Created 6 years, 11 months 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 22 matching lines...) Expand all
33 public: 33 public:
34 virtual ~Json(); 34 virtual ~Json();
35 35
36 // Returns a new instance of |Json| object. 36 // Returns a new instance of |Json| object.
37 static scoped_ptr<Json> Build(); 37 static scoped_ptr<Json> Build();
38 38
39 // Parses the |json| string and returns true if |json| is valid and it is an 39 // Parses the |json| string and returns true if |json| is valid and it is an
40 // object. 40 // object.
41 virtual bool ParseObject(const std::string& json) = 0; 41 virtual bool ParseObject(const std::string& json) = 0;
42 42
43 // Sets |value| to the string for |key| if it exists, or false if the key 43 // Sets |value| to the string for |key| if it exists and has a string value.
44 // doesn't exist or doesn't correspond to a string. The JSON object must be 44 // Returns false if the key doesn't exist or doesn't correspond to a string.
45 // parsed successfully in ParseObject() before invoking this method. 45 // The JSON object must be parsed successfully in ParseObject() before
46 // invoking this method.
46 virtual bool GetStringValueForKey(const std::string& key, 47 virtual bool GetStringValueForKey(const std::string& key,
47 std::string* value) const = 0; 48 std::string* value) const = 0;
48 49
50 // Sets |value| to the dictionary for |key| if it exists and has a dictionary
51 // value. Returns false if the key doesn't exist or doesn't correspond to a
52 // dictionary. The JSON object must be parsed successfully in ParseObject()
53 // before invoking this method.
54 virtual bool GetJsonValueForKey(const std::string& key,
55 scoped_ptr<Json>* value) const = 0;
56
49 protected: 57 protected:
50 Json(); 58 Json();
51 }; 59 };
52 60
53 } // namespace addressinput 61 } // namespace addressinput
54 } // namespace i18n 62 } // namespace i18n
55 63
56 #endif // I18N_ADDRESSINPUT_UTIL_JSON_H_ 64 #endif // I18N_ADDRESSINPUT_UTIL_JSON_H_
OLDNEW
« no previous file with comments | « third_party/libaddressinput/chromium/cpp/src/rule.cc ('k') | third_party/libaddressinput/chromium/cpp/src/util/json.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698