void CommandLine::AppendArguments(const CommandLine& other, bool include_program) { if(include_program) { SetProgram(other.GetProgram()); } AppendSwitchesAndArguments(*this, other.argv()); }
void CommandLine::AppendArguments(const CommandLine& other, bool include_program) { // 验证include_program是否正确使用. // 逻辑不是必要的但这样更清晰. DCHECK_EQ(include_program, !other.GetProgram().empty()); command_line_string_ += L" " + other.command_line_string_; std::map<std::string, StringType>::const_iterator i; for(i=other.switches_.begin(); i!=other.switches_.end(); ++i) { switches_[i->first] = i->second; } }