OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_SYSTEM_NAME_VALUE_PAIRS_PARSER_H_ | 5 #ifndef CHROMEOS_SYSTEM_NAME_VALUE_PAIRS_PARSER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_SYSTEM_NAME_VALUE_PAIRS_PARSER_H_ | 6 #define CHROMEOS_SYSTEM_NAME_VALUE_PAIRS_PARSER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "chromeos/chromeos_export.h" |
12 | 13 |
13 namespace base { | 14 namespace base { |
14 class FilePath; | 15 class FilePath; |
15 } | 16 } |
16 | 17 |
17 namespace chromeos { | 18 namespace chromeos { |
18 namespace system { | 19 namespace system { |
19 | 20 |
20 // The parser is used to get machine info as name-value pairs. Defined | 21 // The parser is used to get machine info as name-value pairs. Defined |
21 // here to be accessible by tests. | 22 // here to be accessible by tests. |
22 class NameValuePairsParser { | 23 class CHROMEOS_EXPORT NameValuePairsParser { |
23 public: | 24 public: |
24 typedef std::map<std::string, std::string> NameValueMap; | 25 typedef std::map<std::string, std::string> NameValueMap; |
25 | 26 |
26 // The obtained info will be written into the given map. | 27 // The obtained info will be written into the given map. |
27 explicit NameValuePairsParser(NameValueMap* map); | 28 explicit NameValuePairsParser(NameValueMap* map); |
28 | 29 |
29 void AddNameValuePair(const std::string& key, const std::string& value); | 30 void AddNameValuePair(const std::string& key, const std::string& value); |
30 | 31 |
31 // Executes tool and inserts (key, <output>) into map_. | 32 // Executes tool and inserts (key, <output>) into map_. |
32 // The program name (argv[0]) should be an absolute path. The function | 33 // The program name (argv[0]) should be an absolute path. The function |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 | 73 |
73 private: | 74 private: |
74 NameValueMap* map_; | 75 NameValueMap* map_; |
75 | 76 |
76 DISALLOW_COPY_AND_ASSIGN(NameValuePairsParser); | 77 DISALLOW_COPY_AND_ASSIGN(NameValuePairsParser); |
77 }; | 78 }; |
78 | 79 |
79 } // namespace system | 80 } // namespace system |
80 } // namespace chromeos | 81 } // namespace chromeos |
81 | 82 |
82 #endif // CHROME_BROWSER_CHROMEOS_SYSTEM_NAME_VALUE_PAIRS_PARSER_H_ | 83 #endif // CHROMEOS_SYSTEM_NAME_VALUE_PAIRS_PARSER_H_ |
OLD | NEW |