diff options
author | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-10 22:30:57 +0000 |
---|---|---|
committer | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-10 22:30:57 +0000 |
commit | e8749c99e678b18cf1b0b4051fab7d518e9ef0f9 (patch) | |
tree | cb496300d8809184e48012b299785eee8da9c466 /base/values.cc | |
parent | 834e1940adac0d36fa796b0bea95e39eb03bae4e (diff) | |
download | chromium_src-e8749c99e678b18cf1b0b4051fab7d518e9ef0f9.zip chromium_src-e8749c99e678b18cf1b0b4051fab7d518e9ef0f9.tar.gz chromium_src-e8749c99e678b18cf1b0b4051fab7d518e9ef0f9.tar.bz2 |
Revert "Added std::string to Value via Set/GetString overloading."
Review URL: http://codereview.chromium.org/13358
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6747 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/values.cc')
-rw-r--r-- | base/values.cc | 42 |
1 files changed, 3 insertions, 39 deletions
diff --git a/base/values.cc b/base/values.cc index b0160e1..dd8062b 100644 --- a/base/values.cc +++ b/base/values.cc @@ -3,7 +3,6 @@ // found in the LICENSE file. #include "base/logging.h" -#include "base/string_util.h" #include "base/values.h" ///////////////////// Value //////////////////// @@ -32,13 +31,8 @@ Value* Value::CreateRealValue(double in_value) { } // static -Value* Value::CreateStringValue(const std::string& in_value) { - return new StringValue(in_value); -} - -// static Value* Value::CreateStringValue(const std::wstring& in_value) { - return new StringValue(WideToUTF8(in_value)); + return new StringValue(in_value); } // static @@ -58,10 +52,6 @@ bool Value::GetAsReal(double* in_value) const { return false; } -bool Value::GetAsString(std::string* in_value) const { - return false; -} - bool Value::GetAsString(std::wstring* in_value) const { return false; } @@ -145,24 +135,12 @@ bool FundamentalValue::Equals(const Value* other) const { ///////////////////// StringValue //////////////////// -StringValue::StringValue(const std::string& in_value) - : Value(TYPE_STRING), - value_(in_value) { - DCHECK(IsStringUTF8(in_value)); -} - StringValue::~StringValue() { } -bool StringValue::GetAsString(std::string* out_value) const { - if (out_value) - *out_value = value_; - return true; -} - bool StringValue::GetAsString(std::wstring* out_value) const { if (out_value) - *out_value = UTF8ToWide(value_); + *out_value = value_; return true; } @@ -173,7 +151,7 @@ Value* StringValue::DeepCopy() const { bool StringValue::Equals(const Value* other) const { if (other->GetType() != GetType()) return false; - std::string lhs, rhs; + std::wstring lhs, rhs; return GetAsString(&lhs) && other->GetAsString(&rhs) && lhs == rhs; } @@ -298,11 +276,6 @@ bool DictionaryValue::SetReal(const std::wstring& path, double in_value) { } bool DictionaryValue::SetString(const std::wstring& path, - const std::string& in_value) { - return Set(path, CreateStringValue(in_value)); -} - -bool DictionaryValue::SetString(const std::wstring& path, const std::wstring& in_value) { return Set(path, CreateStringValue(in_value)); } @@ -362,15 +335,6 @@ bool DictionaryValue::GetReal(const std::wstring& path, } bool DictionaryValue::GetString(const std::wstring& path, - std::string* out_value) const { - Value* value; - if (!Get(path, &value)) - return false; - - return value->GetAsString(out_value); -} - -bool DictionaryValue::GetString(const std::wstring& path, std::wstring* out_value) const { Value* value; if (!Get(path, &value)) |