Class CommandLineUtility

Class Documentation

class CommandLineUtility

Class to parse the command line.

Public Functions

void registerHandler(const std::string &parameter, ParameterHandler handler, bool isMandatory = false)

Assign to each command parameter a lambda function to handle it.

Parameters:
  • parameter – The parameter to handle.

  • handler – The lambda function to handle the parameter value.

  • isMandatory – True if the parameter is mandatory, else otherwise.

bool parse(int argc, char *argv[])

Parse the command line and read all parameters.

Parameters:
  • argc – The number of tokens in the command line.

  • argv – The list of tokens.

Returns:

True if the parsing is successful.