diff options
author | nsylvain@chromium.org <nsylvain@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-03 22:59:43 +0000 |
---|---|---|
committer | nsylvain@chromium.org <nsylvain@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-03 22:59:43 +0000 |
commit | 8e50b600ed1e65789109022709cf5c349748fb4c (patch) | |
tree | d9d57344003604647e1a96a56ef4d21921ec44c0 /base/values.h | |
parent | 0c8a8f7aa683ae7d6c8ba176c1db704cc294defb (diff) | |
download | chromium_src-8e50b600ed1e65789109022709cf5c349748fb4c.zip chromium_src-8e50b600ed1e65789109022709cf5c349748fb4c.tar.gz chromium_src-8e50b600ed1e65789109022709cf5c349748fb4c.tar.bz2 |
revert broken change 10833
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10837 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/values.h')
-rw-r--r-- | base/values.h | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/base/values.h b/base/values.h index 54298d5..cad1311 100644 --- a/base/values.h +++ b/base/values.h @@ -23,10 +23,10 @@ #include <iterator> #include <map> +#include <string> #include <vector> #include "base/basictypes.h" -#include "base/string16.h" class Value; class FundamentalValue; @@ -36,7 +36,7 @@ class DictionaryValue; class ListValue; typedef std::vector<Value*> ValueVector; -typedef std::map<string16, Value*> ValueMap; +typedef std::map<std::wstring, Value*> ValueMap; // The Value class is the base class for Values. A Value can be // instantiated via the Create*Value() factory methods, or by directly @@ -202,7 +202,7 @@ class DictionaryValue : public Value { virtual bool Equals(const Value* other) const; // Returns true if the current dictionary has a value for the given key. - bool HasKey(const string16& key) const; + bool HasKey(const std::wstring& key) const; // Clears any current contents of this dictionary. void Clear(); @@ -216,15 +216,15 @@ class DictionaryValue : public Value { // to the path in that location. // Note that the dictionary takes ownership of the value // referenced by in_value. - bool Set(const string16& path, Value* in_value); + bool Set(const std::wstring& path, Value* in_value); // Convenience forms of Set(). These methods will replace any existing // value at that path, even if it has a different type. - bool SetBoolean(const string16& path, bool in_value); - bool SetInteger(const string16& path, int in_value); - bool SetReal(const string16& path, double in_value); - bool SetString(const string16& path, const std::string& in_value); - bool SetString(const string16& path, const string16& in_value); + bool SetBoolean(const std::wstring& path, bool in_value); + bool SetInteger(const std::wstring& path, int in_value); + bool SetReal(const std::wstring& path, double in_value); + bool SetString(const std::wstring& path, const std::string& in_value); + bool SetString(const std::wstring& path, const std::wstring& in_value); // Gets the Value associated with the given path starting from this object. // A path has the form "<key>" or "<key>.<key>.[...]", where "." indexes @@ -233,20 +233,20 @@ class DictionaryValue : public Value { // through the "value" parameter, and the function will return true. // Otherwise, it will return false and "value" will be untouched. // Note that the dictionary always owns the value that's returned. - bool Get(const string16& path, Value** out_value) const; + bool Get(const std::wstring& path, Value** out_value) const; // These are convenience forms of Get(). The value will be retrieved // and the return value will be true if the path is valid and the value at // the end of the path can be returned in the form specified. - bool GetBoolean(const string16& path, bool* out_value) const; - bool GetInteger(const string16& path, int* out_value) const; - bool GetReal(const string16& path, double* out_value) const; - bool GetString(const string16& path, std::string* out_value) const; - bool GetString(const string16& path, string16* out_value) const; - bool GetBinary(const string16& path, BinaryValue** out_value) const; - bool GetDictionary(const string16& path, + bool GetBoolean(const std::wstring& path, bool* out_value) const; + bool GetInteger(const std::wstring& path, int* out_value) const; + bool GetReal(const std::wstring& path, double* out_value) const; + bool GetString(const std::wstring& path, std::string* out_value) const; + bool GetString(const std::wstring& path, std::wstring* out_value) const; + bool GetBinary(const std::wstring& path, BinaryValue** out_value) const; + bool GetDictionary(const std::wstring& path, DictionaryValue** out_value) const; - bool GetList(const string16& path, ListValue** out_value) const; + bool GetList(const std::wstring& path, ListValue** out_value) const; // Removes the Value with the specified path from this dictionary (or one // of its child dictionaries, if the path is more than just a local key). @@ -254,16 +254,16 @@ class DictionaryValue : public Value { // passed out via out_value. If |out_value| is NULL, the removed value will // be deleted. This method returns true if |path| is a valid path; otherwise // it will return false and the DictionaryValue object will be unchanged. - bool Remove(const string16& path, Value** out_value); + bool Remove(const std::wstring& path, Value** out_value); // This class provides an iterator for the keys in the dictionary. // It can't be used to modify the dictionary. class key_iterator - : private std::iterator<std::input_iterator_tag, const string16> { + : private std::iterator<std::input_iterator_tag, const std::wstring> { public: key_iterator(ValueMap::const_iterator itr) { itr_ = itr; } key_iterator operator++() { ++itr_; return *this; } - const string16& operator*() { return itr_->first; } + const std::wstring& operator*() { return itr_->first; } bool operator!=(const key_iterator& other) { return itr_ != other.itr_; } bool operator==(const key_iterator& other) { return itr_ == other.itr_; } @@ -280,7 +280,7 @@ class DictionaryValue : public Value { // Associates the value |in_value| with the |key|. This method should be // used instead of "dictionary_[key] = foo" so that any previous value can // be properly deleted. - void SetInCurrentNode(const string16& key, Value* in_value); + void SetInCurrentNode(const std::wstring& key, Value* in_value); ValueMap dictionary_; }; |