Definition at line 2508 of file mainIDo.cpp. References ILOG_ERROR, and mExports. Referenced by CleanAverages(), ComputeAverages(), DoRepositoryExec(), DoSystem(), IExec(), and RepositoryExec(). 02509 { 02510 String line = cmdLine; 02511 String::size_type start = line.find("${"); 02512 while (start != String::npos) 02513 { 02514 String::size_type end = line.find("}", start+2); 02515 String var = line.substr(start+2, end - (start+2)); 02516 String val; 02517 if (!mExports.Get(var, val)) 02518 { 02519 char* envVal = getenv(var.c_str()); 02520 if (envVal) 02521 { 02522 val = String(envVal); 02523 } 02524 else 02525 { 02526 ILOG_ERROR("ResolveExports: unknown variable " << var); 02527 return ""; 02528 } 02529 } 02530 line = line.replace(start, var.size()+3, val); 02531 start = line.find("${"); 02532 } 02533 return line; 02534 }
|