summaryrefslogtreecommitdiffstats
path: root/base/values.h
diff options
context:
space:
mode:
authorviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-31 04:56:14 +0000
committerviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-31 04:56:14 +0000
commit9e4cda73357837678196a948b270862f0c0d8ba8 (patch)
tree63bde0071949debacaa990d50eacdb4c982f8383 /base/values.h
parent219ba8cbe322f5f0c656f95eba1d6a2bce56c201 (diff)
downloadchromium_src-9e4cda73357837678196a948b270862f0c0d8ba8.zip
chromium_src-9e4cda73357837678196a948b270862f0c0d8ba8.tar.gz
chromium_src-9e4cda73357837678196a948b270862f0c0d8ba8.tar.bz2
Make ValuesTest use std::strings (instead of wstrings) for dictionary keys.
For now, keep the deprecated tests to check compatibility. BUG=23581 TEST=base_unittests Review URL: http://codereview.chromium.org/3041038 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54431 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/values.h')
-rw-r--r--base/values.h29
1 files changed, 16 insertions, 13 deletions
diff --git a/base/values.h b/base/values.h
index cc9d0fc..2fc2044 100644
--- a/base/values.h
+++ b/base/values.h
@@ -2,21 +2,21 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// This file specifies a recursive data storage class called Value
-// intended for storing setting and other persistable data.
-// It includes the ability to specify (recursive) lists and dictionaries, so
-// it's fairly expressive. However, the API is optimized for the common case,
-// namely storing a hierarchical tree of simple values. Given a
-// DictionaryValue root, you can easily do things like:
+// This file specifies a recursive data storage class called Value intended for
+// storing setting and other persistable data. It includes the ability to
+// specify (recursive) lists and dictionaries, so it's fairly expressive.
+// However, the API is optimized for the common case, namely storing a
+// hierarchical tree of simple values. Given a DictionaryValue root, you can
+// easily do things like:
//
-// root->SetString(L"global.pages.homepage", L"http://goateleporter.com");
-// std::wstring homepage = L"http://google.com"; // default/fallback value
-// root->GetString(L"global.pages.homepage", &homepage);
+// root->SetString("global.pages.homepage", "http://goateleporter.com");
+// std::string homepage = "http://google.com"; // default/fallback value
+// root->GetString("global.pages.homepage", &homepage);
//
-// where "global" and "pages" are also DictionaryValues, and "homepage"
-// is a string setting. If some elements of the path didn't exist yet,
-// the SetString() method would create the missing elements and attach them
-// to root before attaching the homepage value.
+// where "global" and "pages" are also DictionaryValues, and "homepage" is a
+// string setting. If some elements of the path didn't exist yet, the
+// SetString() method would create the missing elements and attach them to root
+// before attaching the homepage value.
#ifndef BASE_VALUES_H_
#define BASE_VALUES_H_
@@ -202,6 +202,9 @@ class BinaryValue: public Value {
DISALLOW_COPY_AND_ASSIGN(BinaryValue);
};
+// DictionaryValue provides a key-value dictionary with (optional) "path"
+// parsing for recursive access; see the comment at the top of the file. Keys
+// are |std::string|s and should be UTF-8 encoded.
// TODO(viettrungluu): Things marked DEPRECATED will be removed. crbug.com/23581
class DictionaryValue : public Value {
public: