/*** Copyright (C) 2022 J Reece Wilson (a/k/a "Reece"). All rights reserved. File: UtilRun.hpp Date: Author: Reece ***/ #pragma once namespace Aurora::Processes { AUKN_INTERFACE(ICommandFinished, AUI_METHOD(void, OnLines, (const AuList &, buffer)), AUI_METHOD(void, OnBuffered, (const Memory::ByteBuffer &, buffer)), AUI_METHOD(void, OnExit, (AuUInt32, exitCode)) ); struct CommandRun_s { AuString cmd; AuList args; Memory::ByteBuffer stdIn; bool stdOutLongerThan64k {false}; // common constraint on linux and windows, at the very least. linux -> max pipe = 16k, windows -> 16k minimum guaranteed bool stdOutIsText {true}; bool runCallbackOnRandomThread {true}; bool runCallbackOnWorkerPId {}; Async::WorkerPId_t worker; bool syncToResult {}; // default -> async AuSPtr callback; }; AUKN_SYM void RunCommand(const CommandRun_s &in); }