Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1804)

Unified Diff: base/values.h

Issue 3023037: Remove Value/StringValue's ...UTF16() methods in favour of overloading. (Closed)
Patch Set: I'm an idiot. Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/values.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/values.h
diff --git a/base/values.h b/base/values.h
index 2fc2044a8b62e935663780edfa811b5b28b4bdcd..d99a46fa13b692516035bd30b6e6382a75c516ee 100644
--- a/base/values.h
+++ b/base/values.h
@@ -56,8 +56,10 @@ class Value {
static Value* CreateIntegerValue(int in_value);
static Value* CreateRealValue(double in_value);
static Value* CreateStringValue(const std::string& in_value);
- static Value* CreateStringValue(const std::wstring& in_value);
- static Value* CreateStringValueFromUTF16(const string16& in_value);
+ static Value* CreateStringValue(const string16& in_value);
+#if !defined(WCHAR_T_IS_UTF16)
+ /*DEPRECATED*/static Value* CreateStringValue(const std::wstring& in_value);
+#endif
// This one can return NULL if the input isn't valid. If the return value
// is non-null, the new object has taken ownership of the buffer pointer.
@@ -92,8 +94,10 @@ class Value {
virtual bool GetAsInteger(int* out_value) const;
virtual bool GetAsReal(double* out_value) const;
virtual bool GetAsString(std::string* out_value) const;
- virtual bool GetAsString(std::wstring* out_value) const;
- virtual bool GetAsUTF16(string16* out_value) const;
+ virtual bool GetAsString(string16* out_value) const;
+#if !defined(WCHAR_T_IS_UTF16)
+ /*DEPRECATED*/virtual bool GetAsString(std::wstring* out_value) const;
+#endif
// This creates a deep copy of the entire Value tree, and returns a pointer
// to the copy. The caller gets ownership of the copy, of course.
@@ -145,20 +149,22 @@ class StringValue : public Value {
// Initializes a StringValue with a UTF-8 narrow character string.
explicit StringValue(const std::string& in_value);
- // Initializes a StringValue with a wide character string.
- explicit StringValue(const std::wstring& in_value);
-
-#if !defined(WCHAR_T_IS_UTF16)
// Initializes a StringValue with a string16.
explicit StringValue(const string16& in_value);
+
+#if !defined(WCHAR_T_IS_UTF16)
+ // Initializes a StringValue with a wide character string.
+ /*DEPRECATED*/explicit StringValue(const std::wstring& in_value);
#endif
~StringValue();
// Subclassed methods
bool GetAsString(std::string* out_value) const;
- bool GetAsString(std::wstring* out_value) const;
- bool GetAsUTF16(string16* out_value) const;
+ bool GetAsString(string16* out_value) const;
+#if !defined(WCHAR_T_IS_UTF16)
+ /*DEPRECATED*/bool GetAsString(std::wstring* out_value) const;
+#endif
Value* DeepCopy() const;
virtual bool Equals(const Value* other) const;
« no previous file with comments | « no previous file | base/values.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698