3#include <StormByte/system/visibility.h>
19namespace StormByte::System {
30 static constexpr const _EoF EoF = {};
44 Process(
const std::filesystem::path& prog,
const std::vector<std::string>& args = std::vector<std::string>());
51 Process(std::filesystem::path&& prog, std::vector<std::string>&& args = std::vector<std::string>());
104 PROCESS_INFORMATION Pid();
136 friend STORMBYTE_SYSTEM_PUBLIC std::ostream&
operator<<(std::ostream& ostream,
const Process& proc);
182 void Send(
const std::string& str);
193 void ConsumeAndForward(
Process&);
199 std::wstring FullCommand()
const;
208 STORMBYTE_SYSTEM_PUBLIC std::ostream& operator<<(std::ostream&,
const Process&);
Process class for running external programs They will run immediately after creation.
Definition process.hxx:37
PROCESS_INFORMATION m_piProcInfo
Process information.
Definition process.hxx:168
Process & operator=(const Process &proc)=delete
void operator<<(const System::_EoF &eof)
std::unique_ptr< std::thread > m_forwarder
Forwarder thread.
Definition process.hxx:175
Process & operator=(Process &&proc) noexcept
Process(const std::filesystem::path &prog, const std::vector< std::string > &args=std::vector< std::string >())
Process(const Process &proc)=delete
Pipe * m_pstderr
Standard error pipe.
Definition process.hxx:172
Process(Process &&proc) noexcept
virtual ~Process() noexcept
Process & operator<<(const std::string &str)
Process(std::filesystem::path &&prog, std::vector< std::string > &&args=std::vector< std::string >())
Status
Process status.
Definition process.hxx:156
std::vector< std::string > m_arguments
Program arguments.
Definition process.hxx:174
friend STORMBYTE_SYSTEM_PUBLIC std::ostream & operator<<(std::ostream &ostream, const Process &proc)
std::string & operator>>(std::string &str) const
Process & operator>>(Process &proc)
Pipe * m_pstdout
Standard output pipe.
Definition process.hxx:170
std::filesystem::path m_program
Program path.
Definition process.hxx:173
Status m_status
Process status.
Definition process.hxx:163
STARTUPINFO m_siStartInfo
Startup information.
Definition process.hxx:167
Pipe * m_pstdin
Standard input pipe.
Definition process.hxx:171
Forward declaration of Pipe class.
Definition process.hxx:25