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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 InitFromArgv(argv); | 180 InitFromArgv(argv); |
181 } | 181 } |
182 | 182 |
183 CommandLine::~CommandLine() { | 183 CommandLine::~CommandLine() { |
184 } | 184 } |
185 | 185 |
186 #if defined(OS_WIN) | 186 #if defined(OS_WIN) |
187 // static | 187 // static |
188 void CommandLine::set_slash_is_not_a_switch() { | 188 void CommandLine::set_slash_is_not_a_switch() { |
189 // The last switch prefix should be slash, so adjust the size to skip it. | 189 // The last switch prefix should be slash, so adjust the size to skip it. |
190 DCHECK(wcscmp(kSwitchPrefixes[arraysize(kSwitchPrefixes) - 1], L"/") == 0); | 190 DCHECK_EQ(wcscmp(kSwitchPrefixes[arraysize(kSwitchPrefixes) - 1], L"/"), 0); |
191 switch_prefix_count = arraysize(kSwitchPrefixes) - 1; | 191 switch_prefix_count = arraysize(kSwitchPrefixes) - 1; |
192 } | 192 } |
193 #endif | 193 #endif |
194 | 194 |
195 // static | 195 // static |
196 bool CommandLine::Init(int argc, const char* const* argv) { | 196 bool CommandLine::Init(int argc, const char* const* argv) { |
197 if (current_process_commandline_) { | 197 if (current_process_commandline_) { |
198 // If this is intentional, Reset() must be called first. If we are using | 198 // If this is intentional, Reset() must be called first. If we are using |
199 // the shared build mode, we have to share a single object across multiple | 199 // the shared build mode, we have to share a single object across multiple |
200 // shared libraries. | 200 // shared libraries. |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
442 #if defined(OS_WIN) | 442 #if defined(OS_WIN) |
443 arg = QuoteForCommandLineToArgvW(arg, quote_placeholders); | 443 arg = QuoteForCommandLineToArgvW(arg, quote_placeholders); |
444 #endif | 444 #endif |
445 params.append(arg); | 445 params.append(arg); |
446 } | 446 } |
447 } | 447 } |
448 return params; | 448 return params; |
449 } | 449 } |
450 | 450 |
451 } // namespace base | 451 } // namespace base |
OLD | NEW |