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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
43 // Sets |value| to the string for |key| if it exists and has a string value. | 43 // Sets |value| to the string for |key| if it exists and has a string value. |
44 // Returns false if the key doesn't exist or doesn't correspond to a string. | 44 // Returns false if the key doesn't exist or doesn't correspond to a string. |
45 // The JSON object must be parsed successfully in ParseObject() before | 45 // The JSON object must be parsed successfully in ParseObject() before |
46 // invoking this method. | 46 // invoking this method. |
47 virtual bool GetStringValueForKey(const std::string& key, | 47 virtual bool GetStringValueForKey(const std::string& key, |
48 std::string* value) const = 0; | 48 std::string* value) const = 0; |
49 | 49 |
50 // Sets |value| to the dictionary for |key| if it exists and has a dictionary | 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 | 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() | 52 // dictionary. The JSON object must be parsed successfully in ParseObject() |
53 // before invoking this method. | 53 // before invoking this method. The returned object is only gauranteed to be |
Dan Beam
2014/02/01 01:02:36
nit: |value| is only guaranteed to be valid as lon
Evan Stade
2014/02/01 01:11:12
Done.
| |
54 // valid as long as |this| is valid. | |
54 virtual bool GetJsonValueForKey(const std::string& key, | 55 virtual bool GetJsonValueForKey(const std::string& key, |
55 scoped_ptr<Json>* value) const = 0; | 56 scoped_ptr<Json>* value) const = 0; |
56 | 57 |
57 protected: | 58 protected: |
58 Json(); | 59 Json(); |
59 }; | 60 }; |
60 | 61 |
61 } // namespace addressinput | 62 } // namespace addressinput |
62 } // namespace i18n | 63 } // namespace i18n |
63 | 64 |
64 #endif // I18N_ADDRESSINPUT_UTIL_JSON_H_ | 65 #endif // I18N_ADDRESSINPUT_UTIL_JSON_H_ |
OLD | NEW |