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 #include "base/command_line.h" | 5 #include "base/command_line.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <ostream> | 8 #include <ostream> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 #endif | 314 #endif |
315 } | 315 } |
316 | 316 |
317 FilePath CommandLine::GetSwitchValuePath( | 317 FilePath CommandLine::GetSwitchValuePath( |
318 const std::string& switch_string) const { | 318 const std::string& switch_string) const { |
319 return FilePath(GetSwitchValueNative(switch_string)); | 319 return FilePath(GetSwitchValueNative(switch_string)); |
320 } | 320 } |
321 | 321 |
322 CommandLine::StringType CommandLine::GetSwitchValueNative( | 322 CommandLine::StringType CommandLine::GetSwitchValueNative( |
323 const std::string& switch_string) const { | 323 const std::string& switch_string) const { |
324 SwitchMap::const_iterator result = switches_.end(); | 324 SwitchMap::const_iterator result = |
325 result = switches_.find(LowerASCIIOnWindows(switch_string)); | 325 switches_.find(LowerASCIIOnWindows(switch_string)); |
326 return result == switches_.end() ? StringType() : result->second; | 326 return result == switches_.end() ? StringType() : result->second; |
327 } | 327 } |
328 | 328 |
329 void CommandLine::AppendSwitch(const std::string& switch_string) { | 329 void CommandLine::AppendSwitch(const std::string& switch_string) { |
330 AppendSwitchNative(switch_string, StringType()); | 330 AppendSwitchNative(switch_string, StringType()); |
331 } | 331 } |
332 | 332 |
333 void CommandLine::AppendSwitchPath(const std::string& switch_string, | 333 void CommandLine::AppendSwitchPath(const std::string& switch_string, |
334 const FilePath& path) { | 334 const FilePath& path) { |
335 AppendSwitchNative(switch_string, path.value()); | 335 AppendSwitchNative(switch_string, path.value()); |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 int num_args = 0; | 429 int num_args = 0; |
430 wchar_t** args = NULL; | 430 wchar_t** args = NULL; |
431 args = ::CommandLineToArgvW(command_line_string.c_str(), &num_args); | 431 args = ::CommandLineToArgvW(command_line_string.c_str(), &num_args); |
432 | 432 |
433 DPLOG_IF(FATAL, !args) << "CommandLineToArgvW failed on command line: " | 433 DPLOG_IF(FATAL, !args) << "CommandLineToArgvW failed on command line: " |
434 << command_line; | 434 << command_line; |
435 InitFromArgv(num_args, args); | 435 InitFromArgv(num_args, args); |
436 LocalFree(args); | 436 LocalFree(args); |
437 } | 437 } |
438 #endif | 438 #endif |
OLD | NEW |