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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 #endif | 89 #endif |
90 } else { | 90 } else { |
91 command_line.AppendArgNative(arg); | 91 command_line.AppendArgNative(arg); |
92 } | 92 } |
93 } | 93 } |
94 } | 94 } |
95 | 95 |
96 // Lowercase switches for backwards compatiblity *on Windows*. | 96 // Lowercase switches for backwards compatiblity *on Windows*. |
97 std::string LowerASCIIOnWindows(const std::string& string) { | 97 std::string LowerASCIIOnWindows(const std::string& string) { |
98 #if defined(OS_WIN) | 98 #if defined(OS_WIN) |
99 return StringToLowerASCII(string); | 99 return base::StringToLowerASCII(string); |
100 #elif defined(OS_POSIX) | 100 #elif defined(OS_POSIX) |
101 return string; | 101 return string; |
102 #endif | 102 #endif |
103 } | 103 } |
104 | 104 |
105 | 105 |
106 #if defined(OS_WIN) | 106 #if defined(OS_WIN) |
107 // Quote a string as necessary for CommandLineToArgvW compatiblity *on Windows*. | 107 // Quote a string as necessary for CommandLineToArgvW compatiblity *on Windows*. |
108 std::wstring QuoteForCommandLineToArgvW(const std::wstring& arg) { | 108 std::wstring QuoteForCommandLineToArgvW(const std::wstring& arg) { |
109 // We follow the quoting rules of CommandLineToArgvW. | 109 // We follow the quoting rules of CommandLineToArgvW. |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
433 args = ::CommandLineToArgvW(command_line_string.c_str(), &num_args); | 433 args = ::CommandLineToArgvW(command_line_string.c_str(), &num_args); |
434 | 434 |
435 DPLOG_IF(FATAL, !args) << "CommandLineToArgvW failed on command line: " | 435 DPLOG_IF(FATAL, !args) << "CommandLineToArgvW failed on command line: " |
436 << UTF16ToUTF8(command_line); | 436 << UTF16ToUTF8(command_line); |
437 InitFromArgv(num_args, args); | 437 InitFromArgv(num_args, args); |
438 LocalFree(args); | 438 LocalFree(args); |
439 } | 439 } |
440 #endif | 440 #endif |
441 | 441 |
442 } // namespace base | 442 } // namespace base |
OLD | NEW |