本文整理汇总了C++中One::ExecuteWithInput方法的典型用法代码示例。如果您正苦于以下问题:C++ One::ExecuteWithInput方法的具体用法?C++ One::ExecuteWithInput怎么用?C++ One::ExecuteWithInput使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类One
的用法示例。
在下文中一共展示了One::ExecuteWithInput方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: BuildAndExecute
void Ide::BuildAndExecute()
{
if(Build()) {
int time = msecs();
One<Host> h = CreateHostRunDir();
h->ChDir(Nvl(rundir, GetFileFolder(target)));
String cmdline;
if(!runexternal)
cmdline << '\"' << h->GetHostPath(target) << "\" ";
cmdline << ToSystemCharset(runarg);
int exitcode;
switch(runmode) {
case RUN_WINDOW:
HideBottom();
h->Launch(cmdline, FindIndex(SplitFlags(mainconfigparam, true), "GUI") < 0);
break;
case RUN_CONSOLE:
ShowConsole();
PutConsole(String().Cat() << "Executing: " << cmdline);
console.Sync();
exitcode = h->ExecuteWithInput(cmdline);
PutConsole("Finished in " + GetPrintTime(time) + ", exit code: " + AsString(exitcode));
break;
case RUN_FILE: {
HideBottom();
String fn;
if(IsNull(stdout_file))
fn = ForceExt(target, ".ol");
else
fn = stdout_file;
FileOut out(fn);
if(!out) {
PromptOK("Unable to open output file [* " + DeQtf(stdout_file) + "] !");
return;
}
if(h->Execute(cmdline, out) >= 0) {
out.Close();
EditFile(fn);
}
}
}
}
}
示例2: ExecuteWithInput
virtual int ExecuteWithInput(const char *c) { return host->ExecuteWithInput(c); }