OLD | NEW |
(Empty) | |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef THIRD_PARTY_LIBADDRESSINPUT_CHROMIUM_UTIL_JSON_H_ |
| 6 #define THIRD_PARTY_LIBADDRESSINPUT_CHROMIUM_UTIL_JSON_H_ |
| 7 |
| 8 #include "base/basictypes.h" |
| 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/values.h" |
| 11 |
| 12 namespace i18n { |
| 13 namespace addressinput { |
| 14 |
| 15 // This class provides the same interface as ../src/cpp/src/util/json.h but with |
| 16 // a Chromium-specific JSON parser. This is because it didn't make much sense to |
| 17 // have 2 JSON parsers in Chrome's code base, and the standalone library opted |
| 18 // to use rapidjson instead of jsoncpp. See the other file for an explanation of |
| 19 // what this class does. |
| 20 |
| 21 class Json { |
| 22 public: |
| 23 Json(); |
| 24 ~Json(); |
| 25 |
| 26 bool ParseObject(const std::string& json); |
| 27 bool HasStringValueForKey(const std::string& key) const; |
| 28 std::string GetStringValueForKey(const std::string& key) const; |
| 29 |
| 30 private: |
| 31 scoped_ptr<base::DictionaryValue> dict_; |
| 32 |
| 33 DISALLOW_COPY_AND_ASSIGN(Json); |
| 34 }; |
| 35 |
| 36 } // namespace addressinput |
| 37 } // namespace i18n |
| 38 |
| 39 #endif // THIRD_PARTY_LIBADDRESSINPUT_CHROMIUM_UTIL_JSON_H_ |
OLD | NEW |