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

Unified Diff: base/values.cc

Issue 159156: Add space-saving overloads for DictionaryValue::SetXXX... Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 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 | « base/values.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/values.cc
===================================================================
--- base/values.cc (revision 21162)
+++ base/values.cc (working copy)
@@ -294,10 +294,19 @@
return Set(path, CreateBooleanValue(in_value));
}
+bool DictionaryValue::SetBoolean(const wchar_t* path, bool in_value) {
+ return SetBoolean(std::wstring(path), in_value);
+}
+
bool DictionaryValue::SetInteger(const std::wstring& path, int in_value) {
return Set(path, CreateIntegerValue(in_value));
}
+bool DictionaryValue::SetInteger(const wchar_t* path, int in_value) {
+ return SetInteger(std::wstring(path), in_value);
+}
+
+
bool DictionaryValue::SetReal(const std::wstring& path, double in_value) {
return Set(path, CreateRealValue(in_value));
}
@@ -307,11 +316,21 @@
return Set(path, CreateStringValue(in_value));
}
+bool DictionaryValue::SetString(const wchar_t* path,
+ const std::string& in_value) {
+ return SetString(std::wstring(path), in_value);
+}
+
bool DictionaryValue::SetString(const std::wstring& path,
const std::wstring& in_value) {
return Set(path, CreateStringValue(in_value));
}
+bool DictionaryValue::SetString(const wchar_t* path,
+ const std::wstring& in_value) {
+ return SetString(std::wstring(path), in_value);
+}
+
bool DictionaryValue::Get(const std::wstring& path, Value** out_value) const {
std::wstring key = path;
« no previous file with comments | « base/values.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698