| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 #include <shellapi.h> | 9 #include <shellapi.h> |
| 10 #elif defined(OS_POSIX) | 10 #elif defined(OS_POSIX) |
| (...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 | 333 |
| 334 FilePath CommandLine::GetProgram() const { | 334 FilePath CommandLine::GetProgram() const { |
| 335 #if defined(OS_WIN) | 335 #if defined(OS_WIN) |
| 336 return FilePath(program_); | 336 return FilePath(program_); |
| 337 #else | 337 #else |
| 338 DCHECK_GT(argv_.size(), 0U); | 338 DCHECK_GT(argv_.size(), 0U); |
| 339 return FilePath(argv_[0]); | 339 return FilePath(argv_[0]); |
| 340 #endif | 340 #endif |
| 341 } | 341 } |
| 342 | 342 |
| 343 #if defined(OS_WIN) | |
| 344 std::wstring CommandLine::program() const { | |
| 345 return program_; | |
| 346 } | |
| 347 #endif | |
| 348 | |
| 349 #if defined(OS_POSIX) | 343 #if defined(OS_POSIX) |
| 350 std::string CommandLine::command_line_string() const { | 344 std::string CommandLine::command_line_string() const { |
| 351 return JoinString(argv_, ' '); | 345 return JoinString(argv_, ' '); |
| 352 } | 346 } |
| 353 #endif | 347 #endif |
| 354 | 348 |
| 355 #if defined(OS_WIN) | 349 #if defined(OS_WIN) |
| 356 void CommandLine::AppendSwitch(const std::string& switch_string) { | 350 void CommandLine::AppendSwitch(const std::string& switch_string) { |
| 357 command_line_string_.append(L" "); | 351 command_line_string_.append(L" "); |
| 358 command_line_string_.append(kSwitchPrefixes[0] + ASCIIToWide(switch_string)); | 352 command_line_string_.append(kSwitchPrefixes[0] + ASCIIToWide(switch_string)); |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 528 | 522 |
| 529 // private | 523 // private |
| 530 CommandLine::CommandLine() { | 524 CommandLine::CommandLine() { |
| 531 } | 525 } |
| 532 | 526 |
| 533 // static | 527 // static |
| 534 CommandLine* CommandLine::ForCurrentProcessMutable() { | 528 CommandLine* CommandLine::ForCurrentProcessMutable() { |
| 535 DCHECK(current_process_commandline_); | 529 DCHECK(current_process_commandline_); |
| 536 return current_process_commandline_; | 530 return current_process_commandline_; |
| 537 } | 531 } |
| OLD | NEW |