1#ifndef LIBFILEZILLA_PROCESS_HEADER
2#define LIBFILEZILLA_PROCESS_HEADER
17class impersonation_token;
89 redirect_except_stderr
109#if FZ_WINDOWS || FZ_UNIX
167 return write(
s.data(),
s.size());
The buffer class is a simple buffer where data can be appended at the end and consumed at the front....
Definition buffer.hpp:27
The duration class represents a time interval in milliseconds.
Definition time.hpp:291
Simple handler for asynchronous event processing.
Definition event_handler.hpp:55
Impersonation tokens for a given user can be used to spawn processes running as that user.
Definition impersonation.hpp:33
The process class manages an asynchronous process with redirected IO.
Definition process.hpp:61
rwresult write(void const *buffer, size_t len)
Write data data process.
process(thread_pool &pool, event_handler &handler)
Creates instance with non-blocking event-based redirected communication.
void * handle() const
Returns the HANDLE of the process.
rwresult read(void *buffer, size_t len)
Read data from process.
bool spawn(native_string const &cmd, std::vector< native_string > const &args=std::vector< native_string >(), io_redirection redirect_mode=io_redirection::redirect)
Start the process.
process()
Creates instance for blocking I/O.
~process()
If process still running, calls process::kill()
bool stop(duration const &timeout={})
Stops the spawned process.
io_redirection
IO redirection modes.
Definition process.hpp:78
bool spawn(impersonation_token const &it, native_string const &cmd, std::vector< native_string > const &args, io_redirection redirect_mode=io_redirection::redirect)
Creates a process running under the user represented by the impersonation token.
Holds the result of read/write operations.
Definition fsresult.hpp:77
This is the recommended event class.
Definition event.hpp:68
A dumb thread-pool for asynchronous tasks.
Definition thread_pool.hpp:64
Declares event_base and simple_event<>
fz::result and fz::rwresult wrappers for dealing with file system errors.
Sets some global macros and further includes string.hpp.
The namespace used by libfilezilla.
Definition apply.hpp:17
simple_event< process_event_type, process *, process_event_flag > process_event
Definition process.hpp:52
std::wstring native_string
A string in the system's native character type and encoding. Note: This typedef changes depending on...
Definition string.hpp:36
bool dispatch(event_base const &ev, F &&f)
Dispatch for simple_event<> based events to simple functors.
Definition event_handler.hpp:199
bool spawn_detached_process(std::vector< native_string > const &cmd_with_args)
Starts a detached process.
process_event_flag
The type of a process event.
Definition process.hpp:26
@ read
Data has become available.
@ write
data can be written.
Assorted classes dealing with time.