| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef COMPONENTS_PREFS_PREF_VALUE_MAP_H_ | 5 #ifndef COMPONENTS_PREFS_PREF_VALUE_MAP_H_ |
| 6 #define COMPONENTS_PREFS_PREF_VALUE_MAP_H_ | 6 #define COMPONENTS_PREFS_PREF_VALUE_MAP_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 // Clears the map. | 44 // Clears the map. |
| 45 void Clear(); | 45 void Clear(); |
| 46 | 46 |
| 47 // Swaps the contents of two maps. | 47 // Swaps the contents of two maps. |
| 48 void Swap(PrefValueMap* other); | 48 void Swap(PrefValueMap* other); |
| 49 | 49 |
| 50 iterator begin(); | 50 iterator begin(); |
| 51 iterator end(); | 51 iterator end(); |
| 52 const_iterator begin() const; | 52 const_iterator begin() const; |
| 53 const_iterator end() const; | 53 const_iterator end() const; |
| 54 bool empty() const; |
| 54 | 55 |
| 55 // Gets a boolean value for |key| and stores it in |value|. Returns true if | 56 // Gets a boolean value for |key| and stores it in |value|. Returns true if |
| 56 // the value was found and of the proper type. | 57 // the value was found and of the proper type. |
| 57 bool GetBoolean(const std::string& key, bool* value) const; | 58 bool GetBoolean(const std::string& key, bool* value) const; |
| 58 | 59 |
| 59 // Sets the value for |key| to the boolean |value|. | 60 // Sets the value for |key| to the boolean |value|. |
| 60 void SetBoolean(const std::string& key, bool value); | 61 void SetBoolean(const std::string& key, bool value); |
| 61 | 62 |
| 62 // Gets a string value for |key| and stores it in |value|. Returns true if | 63 // Gets a string value for |key| and stores it in |value|. Returns true if |
| 63 // the value was found and of the proper type. | 64 // the value was found and of the proper type. |
| (...skipping 18 matching lines...) Expand all Loading... |
| 82 void GetDifferingKeys(const PrefValueMap* other, | 83 void GetDifferingKeys(const PrefValueMap* other, |
| 83 std::vector<std::string>* differing_keys) const; | 84 std::vector<std::string>* differing_keys) const; |
| 84 | 85 |
| 85 private: | 86 private: |
| 86 Map prefs_; | 87 Map prefs_; |
| 87 | 88 |
| 88 DISALLOW_COPY_AND_ASSIGN(PrefValueMap); | 89 DISALLOW_COPY_AND_ASSIGN(PrefValueMap); |
| 89 }; | 90 }; |
| 90 | 91 |
| 91 #endif // COMPONENTS_PREFS_PREF_VALUE_MAP_H_ | 92 #endif // COMPONENTS_PREFS_PREF_VALUE_MAP_H_ |
| OLD | NEW |