Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(482)

Side by Side Diff: base/command_line.h

Issue 3935001: Rename CommandLine::ARGUMENTS_ONLY to NO_PROGRAM. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | base/command_line.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 12 matching lines...) Expand all
23 #include <string> 23 #include <string>
24 #include <vector> 24 #include <vector>
25 25
26 #include "base/basictypes.h" 26 #include "base/basictypes.h"
27 27
28 class FilePath; 28 class FilePath;
29 class InProcessBrowserTest; 29 class InProcessBrowserTest;
30 30
31 class CommandLine { 31 class CommandLine {
32 public: 32 public:
33 // A constructor for CommandLines that are used only to carry arguments. 33 // A constructor for CommandLines that are used only to carry switches and
34 enum ArgumentsOnly { ARGUMENTS_ONLY }; 34 // arguments.
35 explicit CommandLine(ArgumentsOnly args_only); 35 enum NoProgram { NO_PROGRAM };
36 explicit CommandLine(NoProgram no_program);
36 ~CommandLine(); 37 ~CommandLine();
37 38
38 #if defined(OS_WIN) 39 #if defined(OS_WIN)
39 // The type of native command line arguments. 40 // The type of native command line arguments.
40 typedef std::wstring StringType; 41 typedef std::wstring StringType;
41 42
42 // Initialize by parsing the given command-line string. 43 // Initialize by parsing the given command-line string.
43 // The program name is assumed to be the first item in the string. 44 // The program name is assumed to be the first item in the string.
44 void ParseFromString(const std::wstring& command_line); 45 void ParseFromString(const std::wstring& command_line);
45 static CommandLine FromString(const std::wstring& command_line); 46 static CommandLine FromString(const std::wstring& command_line);
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 std::vector<StringType> args_; 206 std::vector<StringType> args_;
206 207
207 // 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
208 // 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
209 // flags to it. E.g.: 210 // flags to it. E.g.:
210 // CommandLine cl(*CommandLine::ForCurrentProcess()); 211 // CommandLine cl(*CommandLine::ForCurrentProcess());
211 // cl.AppendSwitch(...); 212 // cl.AppendSwitch(...);
212 }; 213 };
213 214
214 #endif // BASE_COMMAND_LINE_H_ 215 #endif // BASE_COMMAND_LINE_H_
OLDNEW
« no previous file with comments | « no previous file | base/command_line.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698