diff options
author | bauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-15 09:51:50 +0000 |
---|---|---|
committer | bauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-15 09:51:50 +0000 |
commit | 8703b2b019d923536a9ad4a8eda2053aa7c7472e (patch) | |
tree | be668fd7d482d45f80f6d7b074e7cf442318cb51 /base/values.cc | |
parent | 2c48f9216fe490c9bfe33b6ed0fa063d6d67e220 (diff) | |
download | chromium_src-8703b2b019d923536a9ad4a8eda2053aa7c7472e.zip chromium_src-8703b2b019d923536a9ad4a8eda2053aa7c7472e.tar.gz chromium_src-8703b2b019d923536a9ad4a8eda2053aa7c7472e.tar.bz2 |
Move FilePath <-> Value conversions into a separate file.
BUG=75276
TEST=none
Review URL: http://codereview.chromium.org/6691011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@78182 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/values.cc')
-rw-r--r-- | base/values.cc | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/base/values.cc b/base/values.cc index 3340f9b..9c96f26 100644 --- a/base/values.cc +++ b/base/values.cc @@ -4,10 +4,8 @@ #include "base/values.h" -#include "base/file_path.h" #include "base/logging.h" #include "base/string_util.h" -#include "base/sys_string_conversions.h" #include "base/utf_string_conversions.h" namespace { @@ -97,19 +95,6 @@ StringValue* Value::CreateStringValue(const string16& in_value) { } // static -StringValue* Value::CreateFilePathValue(const FilePath& in_value) { -#if defined(OS_POSIX) - // Value::SetString only knows about UTF8 strings, so convert the path from - // the system native value to UTF8. - std::string path_utf8 = WideToUTF8(base::SysNativeMBToWide(in_value.value())); - return new StringValue(path_utf8); -#else - return new StringValue(in_value.value()); -#endif - -} - -// static BinaryValue* Value::CreateBinaryValue(char* buffer, size_t size) { return BinaryValue::Create(buffer, size); } @@ -134,10 +119,6 @@ bool Value::GetAsString(string16* out_value) const { return false; } -bool Value::GetAsFilePath(FilePath* out_value) const { - return false; -} - bool Value::GetAsList(ListValue** out_value) { return false; } @@ -269,20 +250,6 @@ bool StringValue::GetAsString(string16* out_value) const { return true; } -bool StringValue::GetAsFilePath(FilePath* out_value) const { - if (out_value) { - FilePath::StringType result; -#if defined(OS_POSIX) - // We store filepaths as UTF8, so convert it back to the system type. - result = base::SysWideToNativeMB(UTF8ToWide(value_)); -#elif defined(OS_WIN) - result = UTF8ToUTF16(value_); -#endif - *out_value = FilePath(result); - } - return true; -} - StringValue* StringValue::DeepCopy() const { return CreateStringValue(value_); } |