| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // This file specifies a recursive data storage class called Value intended for | 5 // This file specifies a recursive data storage class called Value intended for |
| 6 // storing settings and other persistable data. | 6 // storing settings and other persistable data. |
| 7 // | 7 // |
| 8 // A Value represents something that can be stored in JSON or passed to/from | 8 // A Value represents something that can be stored in JSON or passed to/from |
| 9 // JavaScript. As such, it is NOT a generalized variant type, since only the | 9 // JavaScript. As such, it is NOT a generalized variant type, since only the |
| 10 // types supported by JavaScript/JSON are supported. | 10 // types supported by JavaScript/JSON are supported. |
| 11 // | 11 // |
| 12 // IN PARTICULAR this means that there is no support for int64 or unsigned | 12 // IN PARTICULAR this means that there is no support for int64 or unsigned |
| 13 // numbers. Writing JSON with such types would violate the spec. If you need | 13 // numbers. Writing JSON with such types would violate the spec. If you need |
| 14 // something like this, either use a double or make a string value containing | 14 // something like this, either use a double or make a string value containing |
| 15 // the number you want. | 15 // the number you want. |
| 16 | 16 |
| 17 #ifndef BASE_VALUES_H_ | 17 #ifndef BASE_VALUES_H_ |
| 18 #define BASE_VALUES_H_ | 18 #define BASE_VALUES_H_ |
| 19 | 19 |
| 20 #include <iterator> | 20 #include <stddef.h> |
| 21 |
| 22 #include <iosfwd> |
| 21 #include <map> | 23 #include <map> |
| 22 #include <string> | 24 #include <string> |
| 25 #include <utility> |
| 23 #include <vector> | 26 #include <vector> |
| 24 | 27 |
| 25 #include "base/base_export.h" | 28 #include "base/base_export.h" |
| 26 #include "base/basictypes.h" | 29 #include "base/basictypes.h" |
| 27 #include "base/compiler_specific.h" | 30 #include "base/compiler_specific.h" |
| 28 #include "base/memory/scoped_ptr.h" | 31 #include "base/memory/scoped_ptr.h" |
| 29 #include "base/strings/string16.h" | 32 #include "base/strings/string16.h" |
| 30 | 33 |
| 31 // This file declares "using base::Value", etc. at the bottom, so that | 34 // This file declares "using base::Value", etc. at the bottom, so that |
| 32 // current code can use these classes without the base namespace. In | 35 // current code can use these classes without the base namespace. In |
| 33 // new code, please always use base::Value, etc. or add your own | 36 // new code, please always use base::Value, etc. or add your own |
| 34 // "using" declaration. | 37 // "using" declaration. |
| 35 // http://crbug.com/88666 | 38 // http://crbug.com/88666 |
| 36 namespace base { | 39 namespace base { |
| 37 | 40 |
| 38 class BinaryValue; | |
| 39 class DictionaryValue; | 41 class DictionaryValue; |
| 40 class FundamentalValue; | 42 class FundamentalValue; |
| 41 class ListValue; | 43 class ListValue; |
| 42 class StringValue; | 44 class StringValue; |
| 43 class Value; | 45 class Value; |
| 44 | 46 |
| 45 typedef std::vector<Value*> ValueVector; | 47 typedef std::vector<Value*> ValueVector; |
| 46 typedef std::map<std::string, Value*> ValueMap; | 48 typedef std::map<std::string, Value*> ValueMap; |
| 47 | 49 |
| 48 // The Value class is the base class for Values. A Value can be instantiated | 50 // The Value class is the base class for Values. A Value can be instantiated |
| (...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 520 | 522 |
| 521 } // namespace base | 523 } // namespace base |
| 522 | 524 |
| 523 // http://crbug.com/88666 | 525 // http://crbug.com/88666 |
| 524 using base::DictionaryValue; | 526 using base::DictionaryValue; |
| 525 using base::ListValue; | 527 using base::ListValue; |
| 526 using base::StringValue; | 528 using base::StringValue; |
| 527 using base::Value; | 529 using base::Value; |
| 528 | 530 |
| 529 #endif // BASE_VALUES_H_ | 531 #endif // BASE_VALUES_H_ |
| OLD | NEW |