| Index: base/command_line.h
|
| diff --git a/base/command_line.h b/base/command_line.h
|
| index 19df40c4c478bfa9befe59ad9eefc63f5b33c55f..cf298a0e163cebd926403012dc057912e21cff87 100644
|
| --- a/base/command_line.h
|
| +++ b/base/command_line.h
|
| @@ -156,6 +156,9 @@ class BASE_EXPORT CommandLine {
|
|
|
| // Get a copy of all switches, along with their values.
|
| const SwitchMap& GetSwitches() const { return switches_; }
|
| + const std::vector<std::string>& GetSwitchVector() const {
|
| + return switch_vector_;
|
| + }
|
|
|
| // Append a switch [with optional value] to the command line.
|
| // Note: Switches will precede arguments regardless of appending order.
|
| @@ -198,6 +201,9 @@ class BASE_EXPORT CommandLine {
|
| void ParseFromString(const base::string16& command_line);
|
| #endif
|
|
|
| + // Optimizes lookups into this CommandLine, but it can no longer be modified.
|
| + void MakeReadOnly();
|
| +
|
| private:
|
| // Disallow default constructor; a program name must be explicitly specified.
|
| CommandLine();
|
| @@ -214,6 +220,12 @@ class BASE_EXPORT CommandLine {
|
| // also quotes parts with '%' in them.
|
| StringType GetArgumentsStringInternal(bool quote_placeholders) const;
|
|
|
| + // Search for the switch in |switch_vector_|.
|
| + bool HasSwitchVector(const char string_constant[]) const;
|
| +
|
| + // Search for the switch assuming the input is lowercase.
|
| + bool HasSwitchLowerCase(const char string_constant[]) const;
|
| +
|
| // The singleton CommandLine representing the current process's command line.
|
| static CommandLine* current_process_commandline_;
|
|
|
| @@ -225,6 +237,14 @@ class BASE_EXPORT CommandLine {
|
|
|
| // The index after the program and switches, any arguments start here.
|
| size_t begin_args_;
|
| +
|
| + // A vector of switches. This allows looking up a const char* switch without
|
| + // allocating a string. It is initialized when this CommandLine is made
|
| + // read-only.
|
| + std::vector<std::string> switch_vector_;
|
| +
|
| + // This is un-set when this CommandLine is made read-only.
|
| + bool writeable_;
|
| };
|
|
|
| } // namespace base
|
|
|