| 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 // static | 97 // static |
| 98 FundamentalValue* Value::CreateIntegerValue(int in_value) { | 98 FundamentalValue* Value::CreateIntegerValue(int in_value) { |
| 99 return new FundamentalValue(in_value); | 99 return new FundamentalValue(in_value); |
| 100 } | 100 } |
| 101 | 101 |
| 102 // static | 102 // static |
| 103 FundamentalValue* Value::CreateDoubleValue(double in_value) { | 103 FundamentalValue* Value::CreateDoubleValue(double in_value) { |
| 104 return new FundamentalValue(in_value); | 104 return new FundamentalValue(in_value); |
| 105 } | 105 } |
| 106 | 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 { | 107 bool Value::GetAsBoolean(bool* out_value) const { |
| 118 return false; | 108 return false; |
| 119 } | 109 } |
| 120 | 110 |
| 121 bool Value::GetAsInteger(int* out_value) const { | 111 bool Value::GetAsInteger(int* out_value) const { |
| 122 return false; | 112 return false; |
| 123 } | 113 } |
| 124 | 114 |
| 125 bool Value::GetAsDouble(double* out_value) const { | 115 bool Value::GetAsDouble(double* out_value) const { |
| 126 return false; | 116 return false; |
| (...skipping 1023 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1150 | 1140 |
| 1151 std::ostream& operator<<(std::ostream& out, const Value& value) { | 1141 std::ostream& operator<<(std::ostream& out, const Value& value) { |
| 1152 std::string json; | 1142 std::string json; |
| 1153 JSONWriter::WriteWithOptions(&value, | 1143 JSONWriter::WriteWithOptions(&value, |
| 1154 JSONWriter::OPTIONS_PRETTY_PRINT, | 1144 JSONWriter::OPTIONS_PRETTY_PRINT, |
| 1155 &json); | 1145 &json); |
| 1156 return out << json; | 1146 return out << json; |
| 1157 } | 1147 } |
| 1158 | 1148 |
| 1159 } // namespace base | 1149 } // namespace base |
| OLD | NEW |