Chromium Code Reviews| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 48 #if defined(OS_WIN) | 48 #if defined(OS_WIN) |
| 49 // Lowercase a string. This is used to lowercase switch names. | 49 // Lowercase a string. This is used to lowercase switch names. |
| 50 // Is this what we really want? It seems crazy to me. I've left it in | 50 // Is this what we really want? It seems crazy to me. I've left it in |
| 51 // for backwards compatibility on Windows. | 51 // for backwards compatibility on Windows. |
| 52 static void Lowercase(std::string* parameter) { | 52 static void Lowercase(std::string* parameter) { |
| 53 transform(parameter->begin(), parameter->end(), parameter->begin(), | 53 transform(parameter->begin(), parameter->end(), parameter->begin(), |
| 54 tolower); | 54 tolower); |
| 55 } | 55 } |
| 56 #endif | 56 #endif |
| 57 | 57 |
| 58 CommandLine::~CommandLine() { | |
| 59 } | |
| 60 | |
| 58 #if defined(OS_WIN) | 61 #if defined(OS_WIN) |
| 59 CommandLine::CommandLine(ArgumentsOnly args_only) { | 62 CommandLine::CommandLine(ArgumentsOnly args_only) { |
| 60 } | 63 } |
| 61 | 64 |
| 62 void CommandLine::ParseFromString(const std::wstring& command_line) { | 65 void CommandLine::ParseFromString(const std::wstring& command_line) { |
| 63 TrimWhitespace(command_line, TRIM_ALL, &command_line_string_); | 66 TrimWhitespace(command_line, TRIM_ALL, &command_line_string_); |
| 64 | 67 |
| 65 if (command_line_string_.empty()) | 68 if (command_line_string_.empty()) |
| 66 return; | 69 return; |
| 67 | 70 |
| (...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 430 void CommandLine::PrependWrapper(const std::wstring& wrapper_wide) { | 433 void CommandLine::PrependWrapper(const std::wstring& wrapper_wide) { |
| 431 // The wrapper may have embedded arguments (like "gdb --args"). In this case, | 434 // The wrapper may have embedded arguments (like "gdb --args"). In this case, |
| 432 // we don't pretend to do anything fancy, we just split on spaces. | 435 // we don't pretend to do anything fancy, we just split on spaces. |
| 433 const std::string wrapper = base::SysWideToNativeMB(wrapper_wide); | 436 const std::string wrapper = base::SysWideToNativeMB(wrapper_wide); |
| 434 std::vector<std::string> wrapper_and_args; | 437 std::vector<std::string> wrapper_and_args; |
| 435 SplitString(wrapper, ' ', &wrapper_and_args); | 438 SplitString(wrapper, ' ', &wrapper_and_args); |
| 436 argv_.insert(argv_.begin(), wrapper_and_args.begin(), wrapper_and_args.end()); | 439 argv_.insert(argv_.begin(), wrapper_and_args.begin(), wrapper_and_args.end()); |
| 437 } | 440 } |
| 438 | 441 |
| 439 #endif | 442 #endif |
| 443 | |
| 444 CommandLine::CommandLine() { | |
|
Evan Martin
2010/07/15 17:37:33
Maybe add a comment near this saying "private". I
Elliot Glaysher
2010/07/15 18:08:10
Added comment.
| |
| 445 } | |
| OLD | NEW |