Lines Matching defs:cmd_buf
257 StringPiece TranslateCommand(const char* in, string* cmd_buf) {
258 const size_t orig_size = cmd_buf->size();
271 *cmd_buf += *in;
284 *cmd_buf += *in;
288 *cmd_buf += "$$";
293 cmd_buf->resize(cmd_buf->size()-1);
295 *cmd_buf += ' ';
300 *cmd_buf += '\\';
304 *cmd_buf += *in;
317 cmd_buf->resize(cmd_buf->size()-1);
321 char c = (*cmd_buf)[cmd_buf->size()-1];
324 cmd_buf->resize(cmd_buf->size() - 1);
327 return StringPiece(cmd_buf->data() + orig_size,
328 cmd_buf->size() - orig_size);
398 string* cmd_buf,
412 size_t cmd_begin = cmd_buf->size();
414 if (!cmd_buf->empty()) {
415 *cmd_buf += " && ";
425 *cmd_buf += '(';
427 size_t cmd_start = cmd_buf->size();
428 StringPiece translated = TranslateCommand(in, cmd_buf);
438 cmd_buf->resize(cmd_begin);
444 cmd_buf->insert(cmd_start + pos, gomacc_);
453 *cmd_buf += " ; true";
457 *cmd_buf += " )";
463 bool GetDepfile(const DepNode* node, string* cmd_buf, string* depfile) {
471 *cmd_buf += ' ';
472 bool result = GetDepfileFromCommand(cmd_buf, depfile);
473 cmd_buf->resize(cmd_buf->size()-1);
477 void EmitDepfile(NinjaNode* nn, string* cmd_buf, ostringstream* o) {
480 if (!GetDepfile(node, cmd_buf, &depfile))
497 string cmd_buf;
499 &cmd_buf, &description);
501 EmitDepfile(nn, &cmd_buf, o);
505 if (cmd_buf.size() > 100 * 1000) {
507 *o << " rspfile_content = " << cmd_buf << "\n";
510 EscapeShell(&cmd_buf);
511 *o << " command = " << shell_ << " -c \"" << cmd_buf << "\"\n";