| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 CHROME_COMMON_INI_PARSER_H_ | 5 #ifndef CHROME_COMMON_INI_PARSER_H_ |
| 6 #define CHROME_COMMON_INI_PARSER_H_ | 6 #define CHROME_COMMON_INI_PARSER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 const std::string& value) = 0; | 39 const std::string& value) = 0; |
| 40 | 40 |
| 41 bool used_; | 41 bool used_; |
| 42 }; | 42 }; |
| 43 | 43 |
| 44 // Parsed values are stored as strings at the "section.key" path. Triplets with | 44 // Parsed values are stored as strings at the "section.key" path. Triplets with |
| 45 // |section| or |key| parameters containing '.' are ignored. | 45 // |section| or |key| parameters containing '.' are ignored. |
| 46 class DictionaryValueINIParser : public INIParser { | 46 class DictionaryValueINIParser : public INIParser { |
| 47 public: | 47 public: |
| 48 DictionaryValueINIParser(); | 48 DictionaryValueINIParser(); |
| 49 virtual ~DictionaryValueINIParser(); | 49 ~DictionaryValueINIParser() override; |
| 50 | 50 |
| 51 const base::DictionaryValue& root() const { return root_; } | 51 const base::DictionaryValue& root() const { return root_; } |
| 52 | 52 |
| 53 private: | 53 private: |
| 54 // INIParser implementation. | 54 // INIParser implementation. |
| 55 virtual void HandleTriplet(const std::string& section, | 55 void HandleTriplet(const std::string& section, |
| 56 const std::string& key, | 56 const std::string& key, |
| 57 const std::string& value) override; | 57 const std::string& value) override; |
| 58 | 58 |
| 59 base::DictionaryValue root_; | 59 base::DictionaryValue root_; |
| 60 | 60 |
| 61 DISALLOW_COPY_AND_ASSIGN(DictionaryValueINIParser); | 61 DISALLOW_COPY_AND_ASSIGN(DictionaryValueINIParser); |
| 62 }; | 62 }; |
| 63 | 63 |
| 64 #endif // CHROME_COMMON_INI_PARSER_H_ | 64 #endif // CHROME_COMMON_INI_PARSER_H_ |
| OLD | NEW |