MCPcopy Create free account
hub / github.com/arun11299/cpp-subprocess / check_output_impl

Function check_output_impl

cpp-subprocess/subprocess.hpp:2153–2163  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2151{
2152 template<typename F, typename... Args>
2153 OutBuffer check_output_impl(F& farg, Args&&... args)
2154 {
2155 static_assert(!detail::has_type<output, detail::param_pack<Args...>>::value, "output not allowed in args");
2156 auto p = Popen(std::forward<F>(farg), std::forward<Args>(args)..., output{PIPE});
2157 auto res = p.communicate();
2158 auto retcode = p.retcode();
2159 if (retcode > 0) {
2160 throw CalledProcessError("Command failed : Non zero retcode", retcode);
2161 }
2162 return std::move(res.first);
2163 }
2164
2165 template<typename F, typename... Args>
2166 int call_impl(F& farg, Args&&... args)

Callers 1

check_outputFunction · 0.85

Calls 4

PopenClass · 0.85
CalledProcessErrorClass · 0.85
retcodeMethod · 0.80
communicateMethod · 0.45

Tested by

no test coverage detected