Skip to content

API

fair::mq::toolsnamespace

Classes and structs

Functions

execute_result execute(
    const std::string& cmd,
    const std::string& prefix = "",
    const std::string& input = "",
    int sig = -1
)

Execute given command in forked process and capture stdout output and exit code.

cmdin
Command to execute
prefixin
How to prefix each captured output line with
inputin
Data which is sent to stdin of the child process
Returns
Captured stdout output and exit code
execute_result execute(
    const std::string& cmd,
    const std::string& prefix,
    const std::string& input,
    int sig,
    std::chrono::milliseconds timeout
)

Same as above, but kill the child process (SIGKILL) if it runs longer than timeout. A timeout of zero means no limit.

template<typename ... T>
auto ToString(T&&... t) -> std::string

concatenates a variable number of args with the << operator via a stringstream

t
objects to be concatenated
Returns
concatenated string
auto ToStrVector(
    const int argc,
    char*const* argv,
    const bool dropProgramName = true
) -> std::vector< std::string >

convert command line arguments from main function to vector of strings

bool StrEndsWith(std::string const& str, std::string const& end)

No comment in the header yet.