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 #include <cstdio> | 5 #include <cstdio> |
6 #include <iostream> | 6 #include <iostream> |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 if (!value->GetAsDictionary(&dict)) { | 100 if (!value->GetAsDictionary(&dict)) { |
101 LOG(ERROR) << "File '" << filename | 101 LOG(ERROR) << "File '" << filename |
102 << "' does not contain a dictionary as expected, but type " | 102 << "' does not contain a dictionary as expected, but type " |
103 << value->GetType(); | 103 << value->GetType(); |
104 } | 104 } |
105 | 105 |
106 return make_scoped_ptr(dict); | 106 return make_scoped_ptr(dict); |
107 } | 107 } |
108 | 108 |
109 int main(int argc, const char* argv[]) { | 109 int main(int argc, const char* argv[]) { |
110 CommandLine::Init(argc, argv); | 110 base::CommandLine::Init(argc, argv); |
111 | 111 |
112 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 112 const base::CommandLine& command_line = |
113 CommandLine::StringVector args = command_line.GetArgs(); | 113 *base::CommandLine::ForCurrentProcess(); |
| 114 base::CommandLine::StringVector args = command_line.GetArgs(); |
114 if (args.size() != 2) { | 115 if (args.size() != 2) { |
115 PrintHelp(); | 116 PrintHelp(); |
116 return kStatusArgumentError; | 117 return kStatusArgumentError; |
117 } | 118 } |
118 | 119 |
119 scoped_ptr<base::DictionaryValue> onc_object = ReadDictionary(args[1]); | 120 scoped_ptr<base::DictionaryValue> onc_object = ReadDictionary(args[1]); |
120 | 121 |
121 if (!onc_object) | 122 if (!onc_object) |
122 return kStatusJsonError; | 123 return kStatusJsonError; |
123 | 124 |
(...skipping 30 matching lines...) Expand all Loading... |
154 case chromeos::onc::Validator::VALID: | 155 case chromeos::onc::Validator::VALID: |
155 return kStatusValid; | 156 return kStatusValid; |
156 case chromeos::onc::Validator::VALID_WITH_WARNINGS: | 157 case chromeos::onc::Validator::VALID_WITH_WARNINGS: |
157 return kStatusWarnings; | 158 return kStatusWarnings; |
158 case chromeos::onc::Validator::INVALID: | 159 case chromeos::onc::Validator::INVALID: |
159 return kStatusInvalid; | 160 return kStatusInvalid; |
160 default: | 161 default: |
161 CHECK(false); | 162 CHECK(false); |
162 } | 163 } |
163 } | 164 } |
OLD | NEW |