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 #include "chrome/common/ini_parser.h" | 5 #include "chrome/common/ini_parser.h" |
6 | 6 |
| 7 #include <stddef.h> |
| 8 |
7 #include "base/logging.h" | 9 #include "base/logging.h" |
8 #include "base/strings/string_tokenizer.h" | 10 #include "base/strings/string_tokenizer.h" |
9 | 11 |
10 INIParser::INIParser() : used_(false) {} | 12 INIParser::INIParser() : used_(false) {} |
11 | 13 |
12 INIParser::~INIParser() {} | 14 INIParser::~INIParser() {} |
13 | 15 |
14 void INIParser::Parse(const std::string& content) { | 16 void INIParser::Parse(const std::string& content) { |
15 DCHECK(!used_); | 17 DCHECK(!used_); |
16 used_ = true; | 18 used_ = true; |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 const std::string& key, | 55 const std::string& key, |
54 const std::string& value) { | 56 const std::string& value) { |
55 | 57 |
56 // Checks whether the section and key contain a '.' character. | 58 // Checks whether the section and key contain a '.' character. |
57 // Those sections and keys break DictionaryValue's path format when not | 59 // Those sections and keys break DictionaryValue's path format when not |
58 // using the *WithoutPathExpansion methods. | 60 // using the *WithoutPathExpansion methods. |
59 if (section.find('.') == std::string::npos && | 61 if (section.find('.') == std::string::npos && |
60 key.find('.') == std::string::npos) | 62 key.find('.') == std::string::npos) |
61 root_.SetString(section + "." + key, value); | 63 root_.SetString(section + "." + key, value); |
62 } | 64 } |
OLD | NEW |