diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-15 21:59:08 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-15 21:59:08 +0000 |
commit | 10e42bf623bcc526e25d5b22760cce3d0766039b (patch) | |
tree | 6630df4ba59b7e65622625f64e60dc2b958eb57c /base/command_line.h | |
parent | 22717d1e33abe98ff8f628a5f1c404115f70cdc6 (diff) | |
download | chromium_src-10e42bf623bcc526e25d5b22760cce3d0766039b.zip chromium_src-10e42bf623bcc526e25d5b22760cce3d0766039b.tar.gz chromium_src-10e42bf623bcc526e25d5b22760cce3d0766039b.tar.bz2 |
Store the command line in a more convenient format on non-windows platforms.
Review URL: http://codereview.chromium.org/7249
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3426 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/command_line.h')
-rw-r--r-- | base/command_line.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/base/command_line.h b/base/command_line.h index 7e54fd4..56aa2fc 100644 --- a/base/command_line.h +++ b/base/command_line.h @@ -32,6 +32,7 @@ class CommandLine { CommandLine(const std::wstring& command_line); #elif defined(OS_POSIX) CommandLine(int argc, const char* const* argv); + CommandLine(const std::vector<std::string>& argv); #endif ~CommandLine(); @@ -67,6 +68,11 @@ class CommandLine { // Simply returns the original command line string. std::wstring command_line_string() const; +#if defined(OS_POSIX) + // Returns the original command line string as a vector of strings. + const std::vector<std::string>& argv() const; +#endif + // Returns the program part of the command line string (the first item). std::wstring program() const; @@ -80,6 +86,16 @@ class CommandLine { // Treat everything after this argument as loose parameters. static const wchar_t kSwitchTerminator[]; + // Return a copy of the string prefixed with a switch prefix. + // Used internally. + static std::wstring PrefixedSwitchString(const std::wstring& switch_string); + + // Return a copy of the string prefixed with a switch prefix, + // and appended with the given value. Used internally. + static std::wstring PrefixedSwitchStringWithValue( + const std::wstring& switch_string, + const std::wstring& value_string); + // Appends the given switch string (preceded by a space and a switch // prefix) to the given string. static void AppendSwitch(std::wstring* command_line_string, |