diff options
Diffstat (limited to 'base/command_line.cc')
-rw-r--r-- | base/command_line.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/base/command_line.cc b/base/command_line.cc index cf3e36f..d9a2052 100644 --- a/base/command_line.cc +++ b/base/command_line.cc @@ -334,5 +334,15 @@ void CommandLine::AppendArguments(const CommandLine& other, for (i = other.switches_.begin(); i != other.switches_.end(); ++i) switches_[i->first] = i->second; } + +void CommandLine::PrependWrapper(const std::wstring& wrapper_wide) { + // The wrapper may have embedded arguments (like "gdb --args"). In this case, + // we don't pretend to do anything fancy, we just split on spaces. + const std::string wrapper = WideToASCII(wrapper_wide); + std::vector<std::string> wrapper_and_args; + SplitString(wrapper, ' ', &wrapper_and_args); + argv_.insert(argv_.begin(), wrapper_and_args.begin(), wrapper_and_args.end()); +} + #endif |