FaceModel
 All Classes Namespaces Functions Variables Enumerations Enumerator Pages
Public Types | Public Member Functions | List of all members
iyf::ArgParser Class Reference

utility class to parse command line arguments passed to FaceModel More...

#include <ArgParser.h>

Public Types

enum  Argument {
  CONFIG_FILE = 0, JSON_INPUT, MODEL_OUTFILE, HELP,
  COMPACT, PRETTY, VERBOSE, RESOURCE_PATH,
  NOOP, LAST_ARGUMENT = NOOP
}
 enumeration that defines possible input arguments, used to denote the arguments to return More...
 

Public Member Functions

 ArgParser (int argc, char **argv)
 takes the input parameters from the main function directly and processes them More...
 
std::string getArg (Argument arg)
 returns the value passed via commandline associated to a certain ArgParser::Argument More...
 
bool helpRequested ()
 getter for the help requested flag (-h/–help) More...
 
void printHelp ()
 prints the usage directly to std::cout
 
bool jsonPretty ()
 getter for the print json pretty flag (–pretty) More...
 
bool isVerbose ()
 getter for verbose flag (-v) More...
 

Detailed Description

utility class to parse command line arguments passed to FaceModel

on the one hand this this class parses the input arguments on the other hand its used to generate the help page output

Member Enumeration Documentation

enumeration that defines possible input arguments, used to denote the arguments to return

Enumerator
CONFIG_FILE 

denotes the -c/–config parameter

JSON_INPUT 

denotes the –ouput parameter

MODEL_OUTFILE 

denotes the -i/–input parameter

HELP 

denotes the -h/–help parameter

COMPACT 

denotes the –compact parameter

PRETTY 

denotes the –pretty parameter

VERBOSE 

denotes the -v parameter

RESOURCE_PATH 

denotes the last parameter

NOOP 

denotes the a no operation for internal use parameter

LAST_ARGUMENT 

holds reference to the last value in the enum

Constructor & Destructor Documentation

ArgParser::ArgParser ( int  argc,
char **  argv 
)

takes the input parameters from the main function directly and processes them

Parameters
intargc number of arguments passed in the array
char**argv character array holding the arguments passed via commandline

Member Function Documentation

std::string ArgParser::getArg ( ArgParser::Argument  arg)

returns the value passed via commandline associated to a certain ArgParser::Argument

Parameters
Argumentarg one of the enum values denoting the argument to return
Returns
std::string the value passed to the program via commandline
bool ArgParser::helpRequested ( )

getter for the help requested flag (-h/–help)

Returns
bool true if help was requested, false otherwise
bool ArgParser::isVerbose ( )

getter for verbose flag (-v)

Returns
bool true if the program shall give verbose information, false otherwise
bool ArgParser::jsonPretty ( )

getter for the print json pretty flag (–pretty)

Returns
bool true if –pretty was set, false otherwise or if –compact was set

The documentation for this class was generated from the following files: