| 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 #include "base/values.h" | 5 #include "base/values.h" |
| 6 | 6 |
| 7 #include <string.h> | 7 #include <string.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <ostream> | 10 #include <ostream> |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 } // namespace | 82 } // namespace |
| 83 | 83 |
| 84 Value::~Value() { | 84 Value::~Value() { |
| 85 } | 85 } |
| 86 | 86 |
| 87 // static | 87 // static |
| 88 Value* Value::CreateNullValue() { | 88 Value* Value::CreateNullValue() { |
| 89 return new Value(TYPE_NULL); | 89 return new Value(TYPE_NULL); |
| 90 } | 90 } |
| 91 | 91 |
| 92 // static | |
| 93 FundamentalValue* Value::CreateBooleanValue(bool in_value) { | |
| 94 return new FundamentalValue(in_value); | |
| 95 } | |
| 96 | |
| 97 // static | |
| 98 FundamentalValue* Value::CreateIntegerValue(int in_value) { | |
| 99 return new FundamentalValue(in_value); | |
| 100 } | |
| 101 | |
| 102 // static | |
| 103 FundamentalValue* Value::CreateDoubleValue(double in_value) { | |
| 104 return new FundamentalValue(in_value); | |
| 105 } | |
| 106 | |
| 107 // static | |
| 108 StringValue* Value::CreateStringValue(const std::string& in_value) { | |
| 109 return new StringValue(in_value); | |
| 110 } | |
| 111 | |
| 112 // static | |
| 113 StringValue* Value::CreateStringValue(const string16& in_value) { | |
| 114 return new StringValue(in_value); | |
| 115 } | |
| 116 | |
| 117 bool Value::GetAsBoolean(bool* out_value) const { | 92 bool Value::GetAsBoolean(bool* out_value) const { |
| 118 return false; | 93 return false; |
| 119 } | 94 } |
| 120 | 95 |
| 121 bool Value::GetAsInteger(int* out_value) const { | 96 bool Value::GetAsInteger(int* out_value) const { |
| 122 return false; | 97 return false; |
| 123 } | 98 } |
| 124 | 99 |
| 125 bool Value::GetAsDouble(double* out_value) const { | 100 bool Value::GetAsDouble(double* out_value) const { |
| 126 return false; | 101 return false; |
| (...skipping 1023 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1150 | 1125 |
| 1151 std::ostream& operator<<(std::ostream& out, const Value& value) { | 1126 std::ostream& operator<<(std::ostream& out, const Value& value) { |
| 1152 std::string json; | 1127 std::string json; |
| 1153 JSONWriter::WriteWithOptions(&value, | 1128 JSONWriter::WriteWithOptions(&value, |
| 1154 JSONWriter::OPTIONS_PRETTY_PRINT, | 1129 JSONWriter::OPTIONS_PRETTY_PRINT, |
| 1155 &json); | 1130 &json); |
| 1156 return out << json; | 1131 return out << json; |
| 1157 } | 1132 } |
| 1158 | 1133 |
| 1159 } // namespace base | 1134 } // namespace base |
| OLD | NEW |