summaryrefslogtreecommitdiffstats
path: root/base/command_line.h
diff options
context:
space:
mode:
authorerg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-28 17:25:28 +0000
committererg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-28 17:25:28 +0000
commit5d91c9e739630685fbff5341abdbd1259f0e63ff (patch)
tree04e82f352e32cfa77985b707c55f661a8f733268 /base/command_line.h
parent37e658bd7bcf3e6a6d474f1826b5b03c4485afcb (diff)
downloadchromium_src-5d91c9e739630685fbff5341abdbd1259f0e63ff.zip
chromium_src-5d91c9e739630685fbff5341abdbd1259f0e63ff.tar.gz
chromium_src-5d91c9e739630685fbff5341abdbd1259f0e63ff.tar.bz2
base/ header cleanup. Forward declaration instead of including.
BUG=none TEST=none Review URL: http://codereview.chromium.org/3068004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53969 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/command_line.h')
-rw-r--r--base/command_line.h43
1 files changed, 11 insertions, 32 deletions
diff --git a/base/command_line.h b/base/command_line.h
index b7f01f3..7ef83bc 100644
--- a/base/command_line.h
+++ b/base/command_line.h
@@ -24,10 +24,9 @@
#include <vector>
#include "base/basictypes.h"
-#include "base/file_path.h"
#include "base/logging.h"
-#include "base/string_util.h"
+class FilePath;
class InProcessBrowserTest;
class CommandLine {
@@ -44,11 +43,7 @@ class CommandLine {
// 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;
- }
+ static CommandLine FromString(const std::wstring& command_line);
#elif defined(OS_POSIX)
// The type of native command line arguments.
typedef std::string StringType;
@@ -57,12 +52,8 @@ class CommandLine {
void InitFromArgv(int argc, const char* const* argv);
void InitFromArgv(const std::vector<std::string>& argv);
- CommandLine(int argc, const char* const* argv) {
- InitFromArgv(argc, argv);
- }
- explicit CommandLine(const std::vector<std::string>& argv) {
- InitFromArgv(argv);
- }
+ CommandLine(int argc, const char* const* argv);
+ explicit CommandLine(const std::vector<std::string>& argv);
#endif
// Construct a new, empty command line.
@@ -105,27 +96,19 @@ class CommandLine {
bool HasSwitch(const std::string& switch_string) const;
// Deprecated version of the above.
- bool HasSwitch(const std::wstring& switch_string) const {
- return HasSwitch(WideToASCII(switch_string));
- }
+ bool HasSwitch(const std::wstring& switch_string) const;
// Returns the value associated with the given switch. If the
// switch has no value or isn't present, this method returns
// the empty string.
// TODO(evanm): move these into command_line.cpp once we've fixed the
// wstringness.
- std::string GetSwitchValueASCII(const std::string& switch_string) const {
- return WideToASCII(GetSwitchValue(switch_string));
- }
- FilePath GetSwitchValuePath(const std::string& switch_string) const {
- return FilePath::FromWStringHack(GetSwitchValue(switch_string));
- }
+ std::string GetSwitchValueASCII(const std::string& switch_string) const;
+ FilePath GetSwitchValuePath(const std::string& switch_string) const;
// Deprecated versions of the above.
std::wstring GetSwitchValue(const std::string& switch_string) const;
- std::wstring GetSwitchValue(const std::wstring& switch_string) const {
- return GetSwitchValue(WideToASCII(switch_string));
- }
+ std::wstring GetSwitchValue(const std::wstring& switch_string) const;
// Get the number of switches in this process.
size_t GetSwitchCount() const { return switches_.size(); }
@@ -134,7 +117,7 @@ class CommandLine {
typedef std::map<std::string, StringType> SwitchMap;
// Get a copy of all switches, along with their values
- SwitchMap GetSwitches() const {
+ const SwitchMap& GetSwitches() const {
return switches_;
}
@@ -157,9 +140,7 @@ class CommandLine {
#endif
// Returns the program part of the command line string (the first item).
- FilePath GetProgram() const {
- return FilePath::FromWStringHack(program());
- }
+ FilePath GetProgram() const;
// Returns the program part of the command line string (the first item).
// Deprecated version of the above.
@@ -184,9 +165,7 @@ class CommandLine {
void AppendSwitchWithValue(const std::string& switch_string,
const std::wstring& value_string);
void AppendSwitchWithValue(const std::string& switch_string,
- const std::string& value_string) {
- AppendSwitchWithValue(switch_string, ASCIIToWide(value_string));
- }
+ const std::string& value_string);
// Append a loose value to the command line.
void AppendLooseValue(const std::wstring& value);