예제 #1
0
파일: program.cpp 프로젝트: libyuni/libyuni
	String System(const AnyString& commandline, bool trim, uint timeout)
	{
		Program program;
		program.commandLine(commandline);

		auto output = std::make_shared<CaptureOutput>();
		program.stream(output);
		program.execute(timeout) and (0 == program.wait());
		if (trim)
			output->cout.trim();
		return output->cout;
	}
예제 #2
0
파일: program.cpp 프로젝트: libyuni/libyuni
	bool System(String* cout, String* cerr, const AnyString& commandline, uint timeout)
	{
		Program program;
		program.commandLine(commandline);

		auto output = std::make_shared<CaptureOutput>();
		program.stream(output);
		bool success = program.execute(timeout) and (0 == program.wait());

		if (cout)
			*cout = output->cout;
		if (cerr)
			*cerr = output->cerr;
		return success;
	}
예제 #3
0
파일: program.cpp 프로젝트: libyuni/libyuni
	bool Execute(const AnyString& commandLine, uint timeout)
	{
		Program program;
		program.commandLine(commandLine);
		return (program.execute(timeout)) ? (0 == program.wait()) : false;
	}