| 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 CHROME_BROWSER_CHROMEOS_NAME_VALUE_PAIRS_PARSER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_SYSTEM_NAME_VALUE_PAIRS_PARSER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_NAME_VALUE_PAIRS_PARSER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_SYSTEM_NAME_VALUE_PAIRS_PARSER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
| 14 | 14 |
| 15 namespace chromeos { | 15 namespace chromeos { |
| 16 namespace system { |
| 16 | 17 |
| 17 // The parser is used to get machine info as name-value pairs. Defined | 18 // The parser is used to get machine info as name-value pairs. Defined |
| 18 // here to be accessable by tests. | 19 // here to be accessable by tests. |
| 19 class NameValuePairsParser { | 20 class NameValuePairsParser { |
| 20 public: | 21 public: |
| 21 typedef std::map<std::string, std::string> NameValueMap; | 22 typedef std::map<std::string, std::string> NameValueMap; |
| 22 | 23 |
| 23 // The obtained info will be written into machine_info. | 24 // The obtained info will be written into machine_info. |
| 24 explicit NameValuePairsParser(NameValueMap* map); | 25 explicit NameValuePairsParser(NameValueMap* map); |
| 25 | 26 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 40 // e.g. ParseNameValuePairs("key1=value1 key2=value2", "=", " ") | 41 // e.g. ParseNameValuePairs("key1=value1 key2=value2", "=", " ") |
| 41 bool ParseNameValuePairs(const std::string& in_string, | 42 bool ParseNameValuePairs(const std::string& in_string, |
| 42 const std::string& eq, | 43 const std::string& eq, |
| 43 const std::string& delim); | 44 const std::string& delim); |
| 44 | 45 |
| 45 NameValueMap* map_; | 46 NameValueMap* map_; |
| 46 | 47 |
| 47 DISALLOW_COPY_AND_ASSIGN(NameValuePairsParser); | 48 DISALLOW_COPY_AND_ASSIGN(NameValuePairsParser); |
| 48 }; | 49 }; |
| 49 | 50 |
| 51 } // namespace system |
| 50 } // namespace chromeos | 52 } // namespace chromeos |
| 51 | 53 |
| 52 #endif // CHROME_BROWSER_CHROMEOS_NAME_VALUE_PAIRS_PARSER_H_ | 54 #endif // CHROME_BROWSER_CHROMEOS_SYSTEM_NAME_VALUE_PAIRS_PARSER_H_ |
| OLD | NEW |