Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(49)

Side by Side Diff: chromeos/system/name_value_pairs_parser.cc

Issue 2229383003: chromeos: Use stl utilities from the base namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chromeos/settings/timezone_settings_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "chromeos/system/name_value_pairs_parser.h" 5 #include "chromeos/system/name_value_pairs_parser.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 30 matching lines...) Expand all
41 } 41 }
42 42
43 } // namespace 43 } // namespace
44 44
45 NameValuePairsParser::NameValuePairsParser(NameValueMap* map) 45 NameValuePairsParser::NameValuePairsParser(NameValueMap* map)
46 : map_(map) { 46 : map_(map) {
47 } 47 }
48 48
49 void NameValuePairsParser::AddNameValuePair(const std::string& key, 49 void NameValuePairsParser::AddNameValuePair(const std::string& key,
50 const std::string& value) { 50 const std::string& value) {
51 if (!ContainsKey(*map_, key)) { 51 if (!base::ContainsKey(*map_, key)) {
52 (*map_)[key] = value; 52 (*map_)[key] = value;
53 VLOG(1) << "name: " << key << ", value: " << value; 53 VLOG(1) << "name: " << key << ", value: " << value;
54 } else { 54 } else {
55 LOG(WARNING) << "Key " << key << " already has value " << (*map_)[key] 55 LOG(WARNING) << "Key " << key << " already has value " << (*map_)[key]
56 << ", ignoring new value: " << value; 56 << ", ignoring new value: " << value;
57 } 57 }
58 } 58 }
59 59
60 bool NameValuePairsParser::ParseNameValuePairs(const std::string& in_string, 60 bool NameValuePairsParser::ParseNameValuePairs(const std::string& in_string,
61 const std::string& eq, 61 const std::string& eq,
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 std::string output_string; 142 std::string output_string;
143 if (!GetToolOutput(argc, argv, &output_string)) 143 if (!GetToolOutput(argc, argv, &output_string))
144 return false; 144 return false;
145 145
146 return ParseNameValuePairsWithComments( 146 return ParseNameValuePairsWithComments(
147 output_string, eq, delim, comment_delim); 147 output_string, eq, delim, comment_delim);
148 } 148 }
149 149
150 } // namespace system 150 } // namespace system
151 } // namespace chromeos 151 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/settings/timezone_settings_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698