| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // Arguments with prefixes ('--', '-', and on Windows, '/') are switches. | 6 // Arguments with prefixes ('--', '-', and on Windows, '/') are switches. |
| 7 // Switches will precede all other arguments without switch prefixes. | 7 // Switches will precede all other arguments without switch prefixes. |
| 8 // Switches can optionally have values, delimited by '=', e.g., "-switch=value". | 8 // Switches can optionally have values, delimited by '=', e.g., "-switch=value". |
| 9 // An argument of "--" will terminate switch parsing during initialization, | 9 // An argument of "--" will terminate switch parsing during initialization, |
| 10 // interpreting subsequent tokens as non-switch arguments, regardless of prefix. | 10 // interpreting subsequent tokens as non-switch arguments, regardless of prefix. |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 // Append a switch [with optional value] to the command line. | 127 // Append a switch [with optional value] to the command line. |
| 128 // Note: Switches will precede arguments regardless of appending order. | 128 // Note: Switches will precede arguments regardless of appending order. |
| 129 void AppendSwitch(const std::string& switch_string); | 129 void AppendSwitch(const std::string& switch_string); |
| 130 void AppendSwitchPath(const std::string& switch_string, | 130 void AppendSwitchPath(const std::string& switch_string, |
| 131 const base::FilePath& path); | 131 const base::FilePath& path); |
| 132 void AppendSwitchNative(const std::string& switch_string, | 132 void AppendSwitchNative(const std::string& switch_string, |
| 133 const StringType& value); | 133 const StringType& value); |
| 134 void AppendSwitchASCII(const std::string& switch_string, | 134 void AppendSwitchASCII(const std::string& switch_string, |
| 135 const std::string& value); | 135 const std::string& value); |
| 136 | 136 |
| 137 // Remove a switch to the command line. |
| 138 void RemoveSwitch(const std::string& switch_string); |
| 139 |
| 137 // Copy a set of switches (and any values) from another command line. | 140 // Copy a set of switches (and any values) from another command line. |
| 138 // Commonly used when launching a subprocess. | 141 // Commonly used when launching a subprocess. |
| 139 void CopySwitchesFrom(const CommandLine& source, | 142 void CopySwitchesFrom(const CommandLine& source, |
| 140 const char* const switches[], | 143 const char* const switches[], |
| 141 size_t count); | 144 size_t count); |
| 142 | 145 |
| 143 // Get the remaining arguments to the command. | 146 // Get the remaining arguments to the command. |
| 144 StringVector GetArgs() const; | 147 StringVector GetArgs() const; |
| 145 | 148 |
| 146 // Append an argument to the command line. Note that the argument is quoted | 149 // Append an argument to the command line. Note that the argument is quoted |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 StringVector argv_; | 183 StringVector argv_; |
| 181 | 184 |
| 182 // Parsed-out switch keys and values. | 185 // Parsed-out switch keys and values. |
| 183 SwitchMap switches_; | 186 SwitchMap switches_; |
| 184 | 187 |
| 185 // The index after the program and switches, any arguments start here. | 188 // The index after the program and switches, any arguments start here. |
| 186 size_t begin_args_; | 189 size_t begin_args_; |
| 187 }; | 190 }; |
| 188 | 191 |
| 189 #endif // BASE_COMMAND_LINE_H_ | 192 #endif // BASE_COMMAND_LINE_H_ |
| OLD | NEW |