FaceModel
 All Classes Namespaces Functions Variables Enumerations Enumerator Pages
ArgParser.h
1 //
2 // ArgParser.h
3 // facemodel
4 //
5 // Created by Georg Ursits on 20/03/14.
6 //
7 //
8 
9 #pragma once
10 
11 #include <string>
12 #include <map>
13 
14 namespace iyf
15 {
22  class ArgParser
23  {
24  public:
29  enum Argument
30  {
34  HELP,
39  NOOP,
41  };
42 
49  ArgParser(int argc, char **argv);
50 
58  std::string getArg(Argument arg);
59 
65  bool helpRequested();
66 
70  void printHelp();
71 
77  bool jsonPretty();
78 
84  bool isVerbose();
85 
86  private:
87  std::map<std::string, Argument> argMap;
88  std::string *args;
89  int argumentCount;
90  bool needHelp;
91  bool writeJsonPretty;
92  bool verbose;
93  bool readResourcePath;
94  };
95 }
denotes the –ouput parameter
Definition: ArgParser.h:32
denotes the -v parameter
Definition: ArgParser.h:37
bool helpRequested()
getter for the help requested flag (-h/–help)
Definition: ArgParser.cpp:103
bool isVerbose()
getter for verbose flag (-v)
Definition: ArgParser.cpp:153
denotes the last parameter
Definition: ArgParser.h:38
Argument
enumeration that defines possible input arguments, used to denote the arguments to return ...
Definition: ArgParser.h:29
denotes the –compact parameter
Definition: ArgParser.h:35
denotes the –pretty parameter
Definition: ArgParser.h:36
ArgParser(int argc, char **argv)
takes the input parameters from the main function directly and processes them
Definition: ArgParser.cpp:14
denotes the a no operation for internal use parameter
Definition: ArgParser.h:39
denotes the -h/–help parameter
Definition: ArgParser.h:34
utility class to parse command line arguments passed to FaceModel
Definition: ArgParser.h:22
denotes the -i/–input parameter
Definition: ArgParser.h:33
Definition: ArgParser.h:31
bool jsonPretty()
getter for the print json pretty flag (–pretty)
Definition: ArgParser.cpp:148
std::string getArg(Argument arg)
returns the value passed via commandline associated to a certain ArgParser::Argument ...
Definition: ArgParser.cpp:98
void printHelp()
prints the usage directly to std::cout
Definition: ArgParser.cpp:108
holds reference to the last value in the enum
Definition: ArgParser.h:40