OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 // This class works with command lines: building and parsing. | 5 // This class works with command lines: building and parsing. |
6 // Switches can optionally have a value attached using an equals sign, | 6 // Switches can optionally have a value attached using an equals sign, |
7 // as in "-switch=value". Arguments that aren't prefixed with a | 7 // as in "-switch=value". Arguments that aren't prefixed with a |
8 // switch prefix are considered "loose parameters". Switch names are | 8 // switch prefix are considered "loose parameters". Switch names are |
9 // case-insensitive. An argument of "--" will terminate switch | 9 // case-insensitive. An argument of "--" will terminate switch |
10 // parsing, causing everything after to be considered as loose | 10 // parsing, causing everything after to be considered as loose |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 const std::wstring& value_string); | 107 const std::wstring& value_string); |
108 | 108 |
109 // Append a loose value to the command line. | 109 // Append a loose value to the command line. |
110 void AppendLooseValue(const std::wstring& value); | 110 void AppendLooseValue(const std::wstring& value); |
111 | 111 |
112 // Append the arguments from another command line to this one. | 112 // Append the arguments from another command line to this one. |
113 // If |include_program| is true, include |other|'s program as well. | 113 // If |include_program| is true, include |other|'s program as well. |
114 void AppendArguments(const CommandLine& other, | 114 void AppendArguments(const CommandLine& other, |
115 bool include_program); | 115 bool include_program); |
116 | 116 |
| 117 // On POSIX systems it's common to run processes via a wrapper (like |
| 118 // "valgrind" or "gdb --args"). *Note, only availible on POSIX* |
| 119 void PrependWrapper(const std::wstring& wrapper); |
| 120 |
117 private: | 121 private: |
118 friend class InProcessBrowserTest; | 122 friend class InProcessBrowserTest; |
119 | 123 |
120 CommandLine() {} | 124 CommandLine() {} |
121 | 125 |
122 // Used by InProcessBrowserTest. | 126 // Used by InProcessBrowserTest. |
123 static CommandLine* ForCurrentProcessMutable() { | 127 static CommandLine* ForCurrentProcessMutable() { |
124 DCHECK(current_process_commandline_); | 128 DCHECK(current_process_commandline_); |
125 return current_process_commandline_; | 129 return current_process_commandline_; |
126 } | 130 } |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 std::vector<StringType> loose_values_; | 170 std::vector<StringType> loose_values_; |
167 | 171 |
168 // We allow copy constructors, because a common pattern is to grab a | 172 // We allow copy constructors, because a common pattern is to grab a |
169 // copy of the current process's command line and then add some | 173 // copy of the current process's command line and then add some |
170 // flags to it. E.g.: | 174 // flags to it. E.g.: |
171 // CommandLine cl(*CommandLine::ForCurrentProcess()); | 175 // CommandLine cl(*CommandLine::ForCurrentProcess()); |
172 // cl.AppendSwitch(...); | 176 // cl.AppendSwitch(...); |
173 }; | 177 }; |
174 | 178 |
175 #endif // BASE_COMMAND_LINE_H_ | 179 #endif // BASE_COMMAND_LINE_H_ |
OLD | NEW |