/*
* This header implements a namespace, bp_sys, which wraps various system calls used by baseproc-service.cc.
*
- * When running tests, another header is substituted in place of this one. The substitute provides mocks/stubs
- * for the functions, to avoid calling the real functions and thus allow for unit-level testing.
+ * When running tests, another header is substituted in place of this one. The substitute provides
+ * mocks/stubs for the functions, to avoid calling the real functions and thus allow for unit-level testing.
*/
#ifndef BPSYS_INCLUDED
// Given a string and a list of pairs of (start,end) indices for each argument in that string,
// store a null terminator for the argument. Return a `char *` vector containing the beginning
-// of each argument and a trailing nullptr. (The returned array is invalidated if the string is later modified).
+// of each argument and a trailing nullptr. (The returned array is invalidated if the string is later
+// modified).
std::vector<const char *> separate_args(std::string &s,
const std::list<std::pair<unsigned,unsigned>> &arg_indices);
protected:
string program_name; // storage for program/script and arguments
- std::vector<const char *> exec_arg_parts; // pointer to each argument/part of the program_name, and nullptr
+ // pointer to each argument/part of the program_name, and nullptr:
+ std::vector<const char *> exec_arg_parts;
string stop_command; // storage for stop program/script and arguments
- std::vector<const char *> stop_arg_parts; // pointer to each argument/part of the stop_command, and nullptr
+ // pointer to each argument/part of the stop_command, and nullptr:
+ std::vector<const char *> stop_arg_parts;
string working_dir; // working directory (or empty)
// Given a string and a list of pairs of (start,end) indices for each argument in that string,
// store a null terminator for the argument. Return a `char *` vector containing the beginning
-// of each argument and a trailing nullptr. (The returned array is invalidated if the string is later modified).
+// of each argument and a trailing nullptr. (The returned array is invalidated if the string is
+// later modified).
std::vector<const char *> separate_args(std::string &s,
const std::list<std::pair<unsigned,unsigned>> &arg_indices)
{