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