galaxy 1.0.0
Real-Time C++23 Game Programming Framework. Built on data-driven design principles and agile software engineering.
Loading...
Searching...
No Matches
Subprocess.hpp
Go to the documentation of this file.
1
7
8#ifndef GALAXY_PLATFORM_SUBPROCESS_HPP_
9#define GALAXY_PLATFORM_SUBPROCESS_HPP_
10
11#include <span>
12#include <string_view>
13
14#include <SDL3/SDL_process.h>
15
16namespace galaxy
17{
21 class Subprocess final
22 {
23 public:
27 Subprocess() noexcept;
28
35 Subprocess(std::string_view process, std::span<std::string> args = {});
36
42 ~Subprocess() noexcept;
43
50 void create(std::string_view process, std::span<std::string> args = {});
51
59 [[maybe_unused]]
60 bool wait(const bool block) noexcept;
61
65 void kill() noexcept;
66
67 private:
71 SDL_Process* m_process;
72 };
73} // namespace galaxy
74
75#endif
Manages a subprocess launched by galaxy.
SDL_Process * m_process
Process information and handles.
~Subprocess() noexcept
Destructor.
Subprocess() noexcept
Constructor.
void kill() noexcept
Terminates process.
void create(std::string_view process, std::span< std::string > args={})
Launch a subprocess.
bool wait(const bool block) noexcept
Wait for a process to finish execution.
Timer.hpp galaxy.
Definition Timer.cpp:18