Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(128)

Side by Side Diff: base/command_line.cc

Issue 3549023: CommandLine: deprecate another function on non-Windows (Closed)
Patch Set: Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 switches_.find(lowercased_switch); 325 switches_.find(lowercased_switch);
326 326
327 if (result == switches_.end()) { 327 if (result == switches_.end()) {
328 return CommandLine::StringType(); 328 return CommandLine::StringType();
329 } else { 329 } else {
330 return result->second; 330 return result->second;
331 } 331 }
332 } 332 }
333 333
334 FilePath CommandLine::GetProgram() const { 334 FilePath CommandLine::GetProgram() const {
335 return FilePath::FromWStringHack(program()); 335 #if defined(OS_WIN)
336 return FilePath(program_);
337 #else
338 DCHECK_GT(argv_.size(), 0U);
339 return FilePath(argv_[0]);
340 #endif
336 } 341 }
337 342
338 #if defined(OS_WIN) 343 #if defined(OS_WIN)
339 std::wstring CommandLine::program() const { 344 std::wstring CommandLine::program() const {
340 return program_; 345 return program_;
341 } 346 }
342 #else
343 std::wstring CommandLine::program() const {
344 DCHECK_GT(argv_.size(), 0U);
345 return base::SysNativeMBToWide(argv_[0]);
346 }
347 #endif 347 #endif
348 348
349 #if defined(OS_POSIX) 349 #if defined(OS_POSIX)
350 std::string CommandLine::command_line_string() const { 350 std::string CommandLine::command_line_string() const {
351 return JoinString(argv_, ' '); 351 return JoinString(argv_, ' ');
352 } 352 }
353 #endif 353 #endif
354 354
355 #if defined(OS_WIN) 355 #if defined(OS_WIN)
356 void CommandLine::AppendSwitch(const std::string& switch_string) { 356 void CommandLine::AppendSwitch(const std::string& switch_string) {
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
528 528
529 // private 529 // private
530 CommandLine::CommandLine() { 530 CommandLine::CommandLine() {
531 } 531 }
532 532
533 // static 533 // static
534 CommandLine* CommandLine::ForCurrentProcessMutable() { 534 CommandLine* CommandLine::ForCurrentProcessMutable() {
535 DCHECK(current_process_commandline_); 535 DCHECK(current_process_commandline_);
536 return current_process_commandline_; 536 return current_process_commandline_;
537 } 537 }
OLDNEW
« base/command_line.h ('K') | « base/command_line.h ('k') | base/command_line_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698