MCPcopy Create free account
hub / github.com/Pagghiu/SaneCppLibraries / pipe

Method pipe

Libraries/Process/Process.cpp:61–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59}
60
61SC::Result SC::ProcessChain::pipe(Process& process, const Span<const StringSpan> cmd)
62{
63 // TODO: Expose options to decide if to pipe also stderr
64 SC_TRY_MSG(process.parent == nullptr, "Process::pipe - already in use");
65
66 if (not processes.isEmpty())
67 {
68 PipeDescriptor chainPipe;
69 PipeOptions chainOptions;
70 chainOptions.writeInheritable = true;
71 chainOptions.readInheritable = true;
72 SC_TRY(chainPipe.createPipe(chainOptions));
73 SC_TRY(processes.back->stdOutFd.assign(move(chainPipe.writePipe)));
74 SC_TRY(process.stdInFd.assign(move(chainPipe.readPipe)));
75 }
76 SC_TRY(process.formatArguments(Span<const StringSpan>(cmd)));
77 process.parent = this;
78 processes.queueBack(process);
79 return Result(true);
80}
81
82SC::Result SC::ProcessChain::waitForExitSync()
83{

Callers 15

asyncUploadPipelineMethod · 0.45
processChainPipeDualMethod · 0.45
quickSheetMethod · 0.45
fileToFileMethod · 0.45
fileCompressRemoteMethod · 0.45
receiveEchoBodyMethod · 0.45

Calls 5

createPipeMethod · 0.80
ResultClass · 0.50
isEmptyMethod · 0.45
assignMethod · 0.45
queueBackMethod · 0.45

Tested by 11

asyncUploadPipelineMethod · 0.36
processChainPipeDualMethod · 0.36
quickSheetMethod · 0.36
fileToFileMethod · 0.36
fileCompressRemoteMethod · 0.36