Class SimulateArgs

Class Documentation

class SimulateArgs

A class for generating simulated argc/argv values from an input string.

Public Functions

explicit SimulateArgs(const std::string &args, bool omit_executable_path = false)

Parse string into data structures that can be used to generate simulated argc/argvs.

Parameters:
  • args – - command string to parse into arguments

  • omit_executable_path – - since the first argument is always a path to the executable, by default this class prepends a default (fake) path to the provided argument list. To omit this default path (for example, if you’d like to provide) your own in the input args), set this boolean argument to true.

explicit SimulateArgs(const std::vector<std::string> args, bool omit_executable_path = false)

Store vector of arguments for use simulating arguments.

Parameters:
  • args – - vector of arguments

  • omit_executable_path – - since the first argument is always a path to the executable, by default this class prepends a default (fake) path to the provided argument list. To omit this default path (for example, if you’d like to provide) your own in the input args), set this boolean argument to true.

int argc() const

generate argc

Returns:

argc, argument count

const char *const *argv() const

generate argv

Returns:

pointer to first argument data