diff options
author | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-26 22:39:33 +0000 |
---|---|---|
committer | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-26 22:39:33 +0000 |
commit | 51343d5ae5d463fc4f84f4af79b44962a580cd4f (patch) | |
tree | 8d53ff6a0097950f2732ee5376bf0c83297c9c87 /base/command_line.h | |
parent | 7b9db43fbc1731cabc985f6e026a07a2ceaafc28 (diff) | |
download | chromium_src-51343d5ae5d463fc4f84f4af79b44962a580cd4f.zip chromium_src-51343d5ae5d463fc4f84f4af79b44962a580cd4f.tar.gz chromium_src-51343d5ae5d463fc4f84f4af79b44962a580cd4f.tar.bz2 |
Remove deprecated CommandLine(std::wstring) ctor.
Add a ctor for creating a CommandLine for carrying arguments;
convert all the users to either that or the FilePath version.
BUG=24672
Review URL: http://codereview.chromium.org/329017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30117 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/command_line.h')
-rw-r--r-- | base/command_line.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/base/command_line.h b/base/command_line.h index 91eb892..37a6a4e 100644 --- a/base/command_line.h +++ b/base/command_line.h @@ -32,10 +32,19 @@ class InProcessBrowserTest; class CommandLine { public: + // A constructor for CommandLines that are used only to carry arguments. + enum ArgumentsOnly { ARGUMENTS_ONLY }; + explicit CommandLine(ArgumentsOnly args_only); + #if defined(OS_WIN) // Initialize by parsing the given command-line string. // The program name is assumed to be the first item in the string. void ParseFromString(const std::wstring& command_line); + static CommandLine FromString(const std::wstring& command_line) { + CommandLine cmd; + cmd.ParseFromString(command_line); + return cmd; + } #elif defined(OS_POSIX) // Initialize from an argv vector. void InitFromArgv(int argc, const char* const* argv); @@ -53,9 +62,6 @@ class CommandLine { // |program| is the name of the program to run (aka argv[0]). explicit CommandLine(const FilePath& program); - // Deprecated in favor of FilePath version. - explicit CommandLine(const std::wstring& program); - // Initialize the current process CommandLine singleton. On Windows, // ignores its arguments (we instead parse GetCommandLineW() // directly) because we don't trust the CRT's parsing of the command |