bpf::system::Process::Builder class

Constructors, destructors, conversion operators

Builder() explicit
Builder(const Application& app) explicit

Public functions

auto SetApplication(const String& name) -> Builder&
auto SetWorkingDirectory(const io::File& dir) -> Builder&
auto SetArguments(const collection::Array<String>& args) -> Builder&
auto SetArguments(collection::Array<String>&& args) -> Builder&
auto SetEnvironment(const collection::HashMap<String, String>& env) -> Builder&
auto SetEnvironment(collection::HashMap<String, String>&& env) -> Builder&
auto RedirectInput() -> Builder&
auto RedirectOutput() -> Builder&
auto RedirectError() -> Builder&
auto Build() -> Process

Function documentation

bpf::system::Process::Builder::Builder() explicit

Constructs a Process::Builder

bpf::system::Process::Builder::Builder(const Application& app) explicit

Parameters
app instance of calling Application to copy defaults from

Constructs a Process::Builder

Builder& bpf::system::Process::Builder::SetApplication(const String& name)

Parameters
name the application path or name string (this overload does automatically check the PATH using this Builder's environment)
Returns Builder reference
Exceptions
io::IOException when the application could not be found

Sets the application to run as a separate process

Builder& bpf::system::Process::Builder::SetWorkingDirectory(const io::File& dir)

Parameters
dir the new directory
Returns Builder reference
Exceptions
io::IOException when dir does not exist or is not a directory

Sets the process working directory

Builder& bpf::system::Process::Builder::SetArguments(const collection::Array<String>& args)

Parameters
args arguments to pass to the new process
Returns Builder reference

Sets the arguments

Builder& bpf::system::Process::Builder::SetArguments(collection::Array<String>&& args)

Parameters
args arguments to pass to the new process
Returns Builder reference

Sets the arguments

Builder& bpf::system::Process::Builder::SetEnvironment(const collection::HashMap<String, String>& env)

Parameters
env the new environment
Returns Builder reference

Sets the environment

Builder& bpf::system::Process::Builder::SetEnvironment(collection::HashMap<String, String>&& env)

Parameters
env the new environment
Returns Builder reference

Sets the environment

Builder& bpf::system::Process::Builder::RedirectInput()

Returns Builder reference

Enables standard input redirect

Builder& bpf::system::Process::Builder::RedirectOutput()

Returns Builder reference

Enables standard output redirect

Builder& bpf::system::Process::Builder::RedirectError()

Returns Builder reference

Enables standard error redirect

Process bpf::system::Process::Builder::Build()

Returns instance to represent the new process
Exceptions
OSException in case the process could not be created

Create a process from the information defined in this builder