| 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 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 | 256 |
| 257 FilePath CommandLine::GetProgram() const { | 257 FilePath CommandLine::GetProgram() const { |
| 258 return FilePath(argv_[0]); | 258 return FilePath(argv_[0]); |
| 259 } | 259 } |
| 260 | 260 |
| 261 void CommandLine::SetProgram(const FilePath& program) { | 261 void CommandLine::SetProgram(const FilePath& program) { |
| 262 TrimWhitespace(program.value(), TRIM_ALL, &argv_[0]); | 262 TrimWhitespace(program.value(), TRIM_ALL, &argv_[0]); |
| 263 } | 263 } |
| 264 | 264 |
| 265 bool CommandLine::HasSwitch(const std::string& switch_string) const { | 265 bool CommandLine::HasSwitch(const std::string& switch_string) const { |
| 266 return switches_.find(LowerASCIIOnWindows(switch_string)) != switches_.end(); | 266 DCHECK_EQ(StringToLowerASCII(switch_string), switch_string); |
| 267 return switches_.find(switch_string) != switches_.end(); |
| 267 } | 268 } |
| 268 | 269 |
| 269 bool CommandLine::HasSwitch(const char string_constant[]) const { | 270 bool CommandLine::HasSwitch(const char string_constant[]) const { |
| 270 return HasSwitch(std::string(string_constant)); | 271 return HasSwitch(std::string(string_constant)); |
| 271 } | 272 } |
| 272 | 273 |
| 273 std::string CommandLine::GetSwitchValueASCII( | 274 std::string CommandLine::GetSwitchValueASCII( |
| 274 const std::string& switch_string) const { | 275 const std::string& switch_string) const { |
| 275 StringType value = GetSwitchValueNative(switch_string); | 276 StringType value = GetSwitchValueNative(switch_string); |
| 276 if (!IsStringASCII(value)) { | 277 if (!IsStringASCII(value)) { |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 446 #if defined(OS_WIN) | 447 #if defined(OS_WIN) |
| 447 arg = QuoteForCommandLineToArgvW(arg, quote_placeholders); | 448 arg = QuoteForCommandLineToArgvW(arg, quote_placeholders); |
| 448 #endif | 449 #endif |
| 449 params.append(arg); | 450 params.append(arg); |
| 450 } | 451 } |
| 451 } | 452 } |
| 452 return params; | 453 return params; |
| 453 } | 454 } |
| 454 | 455 |
| 455 } // namespace base | 456 } // namespace base |
| OLD | NEW |