Chromium Code Reviews| 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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 155 // like "valgrind" or "gdb --args". | 155 // like "valgrind" or "gdb --args". |
| 156 void PrependWrapper(const StringType& wrapper); | 156 void PrependWrapper(const StringType& wrapper); |
| 157 | 157 |
| 158 // Copy a set of switches (and their values, if any) from another command | 158 // Copy a set of switches (and their values, if any) from another command |
| 159 // line. Commonly used when launching a subprocess. | 159 // line. Commonly used when launching a subprocess. |
| 160 void CopySwitchesFrom(const CommandLine& source, const char* const switches[], | 160 void CopySwitchesFrom(const CommandLine& source, const char* const switches[], |
| 161 size_t count); | 161 size_t count); |
| 162 | 162 |
| 163 // APIs that work with wstrings are deprecated. | 163 // APIs that work with wstrings are deprecated. |
| 164 // TODO(evanm): remove all of these. | 164 // TODO(evanm): remove all of these. |
| 165 std::wstring program() const; | |
| 166 #if defined(OS_WIN) | 165 #if defined(OS_WIN) |
| 167 // Deprecated on non-Windows. | 166 // Deprecated on non-Windows. |
| 167 std::wstring program() const; | |
|
viettrungluu
2010/10/07 00:28:38
Where is this used in Windows code anyway? (And ma
| |
| 168 bool HasSwitch(const std::wstring& switch_string) const; | 168 bool HasSwitch(const std::wstring& switch_string) const; |
| 169 #endif | 169 #endif |
| 170 | 170 |
| 171 private: | 171 private: |
| 172 friend class InProcessBrowserTest; | 172 friend class InProcessBrowserTest; |
| 173 | 173 |
| 174 CommandLine(); | 174 CommandLine(); |
| 175 | 175 |
| 176 // Used by InProcessBrowserTest. | 176 // Used by InProcessBrowserTest. |
| 177 static CommandLine* ForCurrentProcessMutable(); | 177 static CommandLine* ForCurrentProcessMutable(); |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 206 std::vector<StringType> args_; | 206 std::vector<StringType> args_; |
| 207 | 207 |
| 208 // We allow copy constructors, because a common pattern is to grab a | 208 // We allow copy constructors, because a common pattern is to grab a |
| 209 // copy of the current process's command line and then add some | 209 // copy of the current process's command line and then add some |
| 210 // flags to it. E.g.: | 210 // flags to it. E.g.: |
| 211 // CommandLine cl(*CommandLine::ForCurrentProcess()); | 211 // CommandLine cl(*CommandLine::ForCurrentProcess()); |
| 212 // cl.AppendSwitch(...); | 212 // cl.AppendSwitch(...); |
| 213 }; | 213 }; |
| 214 | 214 |
| 215 #endif // BASE_COMMAND_LINE_H_ | 215 #endif // BASE_COMMAND_LINE_H_ |
| OLD | NEW |