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

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: Add comment. 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 28 matching lines...) Expand all
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, or false if the key
44 // doesn't exist or doesn't correspond to a string. The JSON object must be 44 // doesn't exist or doesn't correspond to a string. The JSON object must be
45 // parsed successfully in ParseObject() before invoking this method. 45 // parsed successfully in ParseObject() before invoking this method.
46 virtual bool GetStringValueForKey(const std::string& key, 46 virtual bool GetStringValueForKey(const std::string& key,
47 std::string* value) const = 0; 47 std::string* value) const = 0;
48 48
49 // Sets |value| to the dictionary for |key| if it exists, or false if the key
50 // doesn't exist or doesn't correspond to a dictionary. The JSON object must
51 // be parsed successfully in ParseObject() before invoking this method.
52 //
53 // The old |value| is discarded, but not deleted. The caller owns the
54 // resulting |value|.
55 virtual bool GetJsonValueForKey(const std::string& key,
Evan Stade 2014/01/18 19:14:32 return a scoped_ptr<Json> or if you want to stick
please use gerrit instead 2014/01/21 18:43:54 Great idea! Done.
56 Json** value) const = 0;
57
49 protected: 58 protected:
50 Json(); 59 Json();
51 }; 60 };
52 61
53 } // namespace addressinput 62 } // namespace addressinput
54 } // namespace i18n 63 } // namespace i18n
55 64
56 #endif // I18N_ADDRESSINPUT_UTIL_JSON_H_ 65 #endif // I18N_ADDRESSINPUT_UTIL_JSON_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698