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

Side by Side Diff: base/values.h

Issue 3033050: Rename DictionaryValue's SetStringFromUTF16() to SetString() (and overload). (Closed)
Patch Set: There shouldn't be wstrings in platform-ind. code. Created 10 years, 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | base/values.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This file specifies a recursive data storage class called Value intended for 5 // This file specifies a recursive data storage class called Value intended for
6 // storing setting and other persistable data. It includes the ability to 6 // storing setting and other persistable data. It includes the ability to
7 // specify (recursive) lists and dictionaries, so it's fairly expressive. 7 // specify (recursive) lists and dictionaries, so it's fairly expressive.
8 // However, the API is optimized for the common case, namely storing a 8 // However, the API is optimized for the common case, namely storing a
9 // hierarchical tree of simple values. Given a DictionaryValue root, you can 9 // hierarchical tree of simple values. Given a DictionaryValue root, you can
10 // easily do things like: 10 // easily do things like:
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 // |in_value|, and therefore |in_value| must be non-NULL. 246 // |in_value|, and therefore |in_value| must be non-NULL.
247 void Set(const std::string& path, Value* in_value); 247 void Set(const std::string& path, Value* in_value);
248 /*DEPRECATED*/void Set(const std::wstring& path, Value* in_value); 248 /*DEPRECATED*/void Set(const std::wstring& path, Value* in_value);
249 249
250 // Convenience forms of Set(). These methods will replace any existing 250 // Convenience forms of Set(). These methods will replace any existing
251 // value at that path, even if it has a different type. 251 // value at that path, even if it has a different type.
252 void SetBoolean(const std::string& path, bool in_value); 252 void SetBoolean(const std::string& path, bool in_value);
253 void SetInteger(const std::string& path, int in_value); 253 void SetInteger(const std::string& path, int in_value);
254 void SetReal(const std::string& path, double in_value); 254 void SetReal(const std::string& path, double in_value);
255 void SetString(const std::string& path, const std::string& in_value); 255 void SetString(const std::string& path, const std::string& in_value);
256 void SetStringFromUTF16(const std::string& path, const string16& in_value); 256 void SetString(const std::string& path, const string16& in_value);
257 /*DEPRECATED*/void SetBoolean(const std::wstring& path, bool in_value); 257 /*DEPRECATED*/void SetBoolean(const std::wstring& path, bool in_value);
258 /*DEPRECATED*/void SetInteger(const std::wstring& path, int in_value); 258 /*DEPRECATED*/void SetInteger(const std::wstring& path, int in_value);
259 /*DEPRECATED*/void SetReal(const std::wstring& path, double in_value); 259 /*DEPRECATED*/void SetReal(const std::wstring& path, double in_value);
260 /*DEPRECATED*/void SetString(const std::wstring& path, 260 /*DEPRECATED*/void SetString(const std::wstring& path,
261 const std::string& in_value); 261 const std::string& in_value);
262 /*DEPRECATED*/void SetString(const std::wstring& path, 262 /*DEPRECATED*/void SetString(const std::wstring& path,
263 const string16& in_value);
264 #if !defined(WCHAR_T_IS_UTF16)
265 /*DEPRECATED*/void SetString(const std::wstring& path,
263 const std::wstring& in_value); 266 const std::wstring& in_value);
264 /*DEPRECATED*/void SetStringFromUTF16(const std::wstring& path, 267 #endif
265 const string16& in_value);
266 268
267 // Like Set(), but without special treatment of '.'. This allows e.g. URLs to 269 // Like Set(), but without special treatment of '.'. This allows e.g. URLs to
268 // be used as paths. 270 // be used as paths.
269 void SetWithoutPathExpansion(const std::string& key, Value* in_value); 271 void SetWithoutPathExpansion(const std::string& key, Value* in_value);
270 /*DEPRECATED*/void SetWithoutPathExpansion(const std::wstring& key, 272 /*DEPRECATED*/void SetWithoutPathExpansion(const std::wstring& key,
271 Value* in_value); 273 Value* in_value);
272 274
273 // Gets the Value associated with the given path starting from this object. 275 // Gets the Value associated with the given path starting from this object.
274 // A path has the form "<key>" or "<key>.<key>.[...]", where "." indexes 276 // A path has the form "<key>" or "<key>.<key>.[...]", where "." indexes
275 // into the next DictionaryValue down. If the path can be resolved 277 // into the next DictionaryValue down. If the path can be resolved
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 // This method deserializes the subclass-specific format into a Value object. 493 // This method deserializes the subclass-specific format into a Value object.
492 // If the return value is non-NULL, the caller takes ownership of returned 494 // If the return value is non-NULL, the caller takes ownership of returned
493 // Value. If the return value is NULL, and if error_code is non-NULL, 495 // Value. If the return value is NULL, and if error_code is non-NULL,
494 // error_code will be set with the underlying error. 496 // error_code will be set with the underlying error.
495 // If |error_message| is non-null, it will be filled in with a formatted 497 // If |error_message| is non-null, it will be filled in with a formatted
496 // error message including the location of the error if appropriate. 498 // error message including the location of the error if appropriate.
497 virtual Value* Deserialize(int* error_code, std::string* error_str) = 0; 499 virtual Value* Deserialize(int* error_code, std::string* error_str) = 0;
498 }; 500 };
499 501
500 #endif // BASE_VALUES_H_ 502 #endif // BASE_VALUES_H_
OLDNEW
« 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