summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authorviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-04 19:35:33 +0000
committerviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-04 19:35:33 +0000
commit698f7f43984b1acbc74b0a64fd2205a3ff4efe07 (patch)
tree91f75dcb443d2d2b861998d091f2dda0706b2056 /base
parentfca868203103ef3d0accbe6dded134364dc222f3 (diff)
downloadchromium_src-698f7f43984b1acbc74b0a64fd2205a3ff4efe07.zip
chromium_src-698f7f43984b1acbc74b0a64fd2205a3ff4efe07.tar.gz
chromium_src-698f7f43984b1acbc74b0a64fd2205a3ff4efe07.tar.bz2
Rename GetStringAsUTF16() to GetString() (and overload), etc.
Also do some drive-by wstring/wchar_t -> string/char changes (in addition to the necessary ones). BUG=none TEST=builds and tests pass Review URL: http://codereview.chromium.org/3091005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54944 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r--base/values.cc32
-rw-r--r--base/values.h19
2 files changed, 15 insertions, 36 deletions
diff --git a/base/values.cc b/base/values.cc
index af801bc..78547a4 100644
--- a/base/values.cc
+++ b/base/values.cc
@@ -565,8 +565,8 @@ bool DictionaryValue::GetString(const std::string& path,
return value->GetAsString(out_value);
}
-bool DictionaryValue::GetStringAsUTF16(const std::string& path,
- string16* out_value) const {
+bool DictionaryValue::GetString(const std::string& path,
+ string16* out_value) const {
Value* value;
if (!Get(path, &value))
return false;
@@ -646,12 +646,6 @@ bool DictionaryValue::GetReal(const std::wstring& path,
return GetReal(WideToUTF8(path), out_value);
}
-// TODO(viettrungluu): or maybe we should get rid of the "AsUTF16" version?
-bool DictionaryValue::GetString(const std::string& path,
- string16* out_value) const {
- return GetStringAsUTF16(path, out_value);
-}
-
// TODO(viettrungluu): Deprecated and to be removed:
bool DictionaryValue::GetString(const std::wstring& path,
std::string* out_value) const {
@@ -669,12 +663,6 @@ bool DictionaryValue::GetString(const std::wstring& path,
}
// TODO(viettrungluu): Deprecated and to be removed:
-bool DictionaryValue::GetStringAsUTF16(const std::wstring& path,
- string16* out_value) const {
- return GetStringAsUTF16(WideToUTF8(path), out_value);
-}
-
-// TODO(viettrungluu): Deprecated and to be removed:
bool DictionaryValue::GetBinary(const std::wstring& path,
BinaryValue** out_value) const {
return GetBinary(WideToUTF8(path), out_value);
@@ -723,7 +711,7 @@ bool DictionaryValue::GetStringWithoutPathExpansion(
return value->GetAsString(out_value);
}
-bool DictionaryValue::GetStringAsUTF16WithoutPathExpansion(
+bool DictionaryValue::GetStringWithoutPathExpansion(
const std::string& key,
string16* out_value) const {
Value* value;
@@ -791,13 +779,6 @@ bool DictionaryValue::GetStringWithoutPathExpansion(
}
// TODO(viettrungluu): Deprecated and to be removed:
-bool DictionaryValue::GetStringAsUTF16WithoutPathExpansion(
- const std::wstring& key,
- string16* out_value) const {
- return GetStringAsUTF16WithoutPathExpansion(WideToUTF8(key), out_value);
-}
-
-// TODO(viettrungluu): Deprecated and to be removed:
bool DictionaryValue::GetDictionaryWithoutPathExpansion(
const std::wstring& key,
DictionaryValue** out_value) const {
@@ -1058,7 +1039,7 @@ bool ListValue::GetString(size_t index, std::string* out_value) const {
return value->GetAsString(out_value);
}
-bool ListValue::GetString(size_t index, std::wstring* out_value) const {
+bool ListValue::GetString(size_t index, string16* out_value) const {
Value* value;
if (!Get(index, &value))
return false;
@@ -1066,13 +1047,16 @@ bool ListValue::GetString(size_t index, std::wstring* out_value) const {
return value->GetAsString(out_value);
}
-bool ListValue::GetStringAsUTF16(size_t index, string16* out_value) const {
+#if !defined(WCHAR_T_IS_UTF16)
+// TODO(viettrungluu): Deprecated and to be removed:
+bool ListValue::GetString(size_t index, std::wstring* out_value) const {
Value* value;
if (!Get(index, &value))
return false;
return value->GetAsString(out_value);
}
+#endif
bool ListValue::GetBinary(size_t index, BinaryValue** out_value) const {
Value* value;
diff --git a/base/values.h b/base/values.h
index 39683a6..333cd02 100644
--- a/base/values.h
+++ b/base/values.h
@@ -289,7 +289,7 @@ class DictionaryValue : public Value {
bool GetInteger(const std::string& path, int* out_value) const;
bool GetReal(const std::string& path, double* out_value) const;
bool GetString(const std::string& path, std::string* out_value) const;
- bool GetStringAsUTF16(const std::string& path, string16* out_value) const;
+ bool GetString(const std::string& path, string16* out_value) const;
bool GetStringASCII(const std::string& path, std::string* out_value) const;
bool GetBinary(const std::string& path, BinaryValue** out_value) const;
bool GetDictionary(const std::string& path,
@@ -299,15 +299,10 @@ class DictionaryValue : public Value {
bool* out_value) const;
/*DEPRECATED*/bool GetInteger(const std::wstring& path, int* out_value) const;
/*DEPRECATED*/bool GetReal(const std::wstring& path, double* out_value) const;
- // Use |GetStringAsUTF16()| instead:
- /*DEPRECATED*/bool GetString(const std::string& path,
- string16* out_value) const;
/*DEPRECATED*/bool GetString(const std::wstring& path,
std::string* out_value) const;
/*DEPRECATED*/bool GetString(const std::wstring& path,
std::wstring* out_value) const;
- /*DEPRECATED*/bool GetStringAsUTF16(const std::wstring& path,
- string16* out_value) const;
/*DEPRECATED*/bool GetBinary(const std::wstring& path,
BinaryValue** out_value) const;
/*DEPRECATED*/bool GetDictionary(const std::wstring& path,
@@ -323,8 +318,8 @@ class DictionaryValue : public Value {
int* out_value) const;
bool GetStringWithoutPathExpansion(const std::string& key,
std::string* out_value) const;
- bool GetStringAsUTF16WithoutPathExpansion(const std::string& key,
- string16* out_value) const;
+ bool GetStringWithoutPathExpansion(const std::string& key,
+ string16* out_value) const;
bool GetDictionaryWithoutPathExpansion(const std::string& key,
DictionaryValue** out_value) const;
bool GetListWithoutPathExpansion(const std::string& key,
@@ -337,8 +332,6 @@ class DictionaryValue : public Value {
const std::wstring& key, std::string* out_value) const;
/*DEPRECATED*/bool GetStringWithoutPathExpansion(
const std::wstring& key, std::wstring* out_value) const;
- /*DEPRECATED*/bool GetStringAsUTF16WithoutPathExpansion(
- const std::wstring& key, string16* out_value) const;
/*DEPRECATED*/bool GetDictionaryWithoutPathExpansion(
const std::wstring& key, DictionaryValue** out_value) const;
/*DEPRECATED*/bool GetListWithoutPathExpansion(const std::wstring& key,
@@ -459,8 +452,10 @@ class ListValue : public Value {
bool GetInteger(size_t index, int* out_value) const;
bool GetReal(size_t index, double* out_value) const;
bool GetString(size_t index, std::string* out_value) const;
- bool GetString(size_t index, std::wstring* out_value) const;
- bool GetStringAsUTF16(size_t index, string16* out_value) const;
+ bool GetString(size_t index, string16* out_value) const;
+#if !defined(WCHAR_T_IS_UTF16)
+ /*DEPRECATED*/bool GetString(size_t index, std::wstring* out_value) const;
+#endif
bool GetBinary(size_t index, BinaryValue** out_value) const;
bool GetDictionary(size_t index, DictionaryValue** out_value) const;
bool GetList(size_t index, ListValue** out_value) const;