| 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 saved as extra arguments. An argument of "--" | 8 // switch prefix are saved as extra arguments. An argument of "--" |
| 9 // will terminate switch parsing, causing everything after to be | 9 // will terminate switch parsing, causing everything after to be |
| 10 // considered as extra arguments. | 10 // considered as extra arguments. |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 const std::string& value); | 166 const std::string& value); |
| 167 | 167 |
| 168 // Append a loose value to the command line. | 168 // Append a loose value to the command line. |
| 169 void AppendLooseValue(const std::wstring& value); | 169 void AppendLooseValue(const std::wstring& value); |
| 170 | 170 |
| 171 // Append the arguments from another command line to this one. | 171 // Append the arguments from another command line to this one. |
| 172 // If |include_program| is true, include |other|'s program as well. | 172 // If |include_program| is true, include |other|'s program as well. |
| 173 void AppendArguments(const CommandLine& other, | 173 void AppendArguments(const CommandLine& other, |
| 174 bool include_program); | 174 bool include_program); |
| 175 | 175 |
| 176 // On POSIX systems it's common to run processes via a wrapper (like | 176 // Insert a command before the current command. Common for debuggers, |
| 177 // "valgrind" or "gdb --args"). | 177 // like "valgrind" or "gdb --args". |
| 178 void PrependWrapper(const std::wstring& wrapper); | 178 void PrependWrapper(const StringType& wrapper); |
| 179 | 179 |
| 180 // Copy a set of switches (and their values, if any) from another command | 180 // Copy a set of switches (and their values, if any) from another command |
| 181 // line. Commonly used when launching a subprocess. | 181 // line. Commonly used when launching a subprocess. |
| 182 void CopySwitchesFrom(const CommandLine& source, const char* const switches[], | 182 void CopySwitchesFrom(const CommandLine& source, const char* const switches[], |
| 183 size_t count); | 183 size_t count); |
| 184 | 184 |
| 185 private: | 185 private: |
| 186 friend class InProcessBrowserTest; | 186 friend class InProcessBrowserTest; |
| 187 | 187 |
| 188 CommandLine(); | 188 CommandLine(); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 std::vector<StringType> args_; | 223 std::vector<StringType> args_; |
| 224 | 224 |
| 225 // We allow copy constructors, because a common pattern is to grab a | 225 // We allow copy constructors, because a common pattern is to grab a |
| 226 // copy of the current process's command line and then add some | 226 // copy of the current process's command line and then add some |
| 227 // flags to it. E.g.: | 227 // flags to it. E.g.: |
| 228 // CommandLine cl(*CommandLine::ForCurrentProcess()); | 228 // CommandLine cl(*CommandLine::ForCurrentProcess()); |
| 229 // cl.AppendSwitch(...); | 229 // cl.AppendSwitch(...); |
| 230 }; | 230 }; |
| 231 | 231 |
| 232 #endif // BASE_COMMAND_LINE_H_ | 232 #endif // BASE_COMMAND_LINE_H_ |
| OLD | NEW |