8 #ifndef COMPONENTS_CPP_UTILS_CONSOLE_H_
9 #define COMPONENTS_CPP_UTILS_CONSOLE_H_
14 #include <argtable3/argtable3.h>
23 enum class ArgType_t { LIT, INT, DBL, STR, REX, FILE, DATE };
30 virtual int getCount();
32 return getCount() > 0;
34 virtual void* getEntry() = 0;
40 struct arg_lit* m_argLit;
43 ArgTableEntry_Lit(std::string shortopts, std::string longopts, std::string glossary);
51 struct arg_int* m_argInt;
53 ArgTableEntry_Int(std::string shortopts, std::string longopts, std::string glossary);
55 int getValue(
int index = 0);
64 struct arg_dbl* m_argDbl;
68 double getValue(
int index = 0);
77 struct arg_str* m_argStr;
79 ArgTableEntry_String(std::string shortopts, std::string longopts, std::string glossary,
int min,
int max);
81 std::string getValue(
int index = 0);
90 struct arg_rex* m_argRex;
93 std::string getValue(
int index = 0);
102 struct arg_file* m_argFile;
104 ArgTableEntry_File(std::string shortopts, std::string longopts, std::string glossary);
106 std::string getFilename(
int index = 0);
107 std::string getBasename(
int index = 0);
108 std::string getExtension(
int index = 0);
117 struct arg_date* m_argDate;
119 ArgTableEntry_Date(std::string shortopts, std::string longopts, std::string glossary);
121 struct tm* getValue(
int index = 0);
131 struct arg_end* m_argEnd;
132 std::list<std::pair<std::string, ArgTableEntry_Generic*>> m_argTableEntries;
139 ArgTableEntry_Date addDate(std::string name, std::string shortopts, std::string longopts, std::string glossary);
140 ArgTableEntry_Double addDouble(std::string name, std::string shortopts, std::string longopts, std::string glossary);
141 ArgTableEntry_File addFile(std::string name, std::string shortopts, std::string longopts, std::string glossary);
142 ArgTableEntry_Int addInt(std::string name, std::string shortopts, std::string longopts, std::string glossary);
143 ArgTableEntry_Lit addLit(std::string name, std::string shortopts, std::string longopts, std::string glossary);
144 ArgTableEntry_String addString(std::string name, std::string shortopts, std::string longopts, std::string glossary,
int min,
int max);
145 int parse(
int argc,
char* argv[]);
146 void printErrors(FILE* fp, std::string progName=
"");
Definition: Console.h:128
~ArgTable()
Definition: Console.cpp:30
void printErrors(FILE *fp, std::string progName="")
Definition: Console.cpp:115
Definition: Console.h:115
ArgTable()
Definition: Console.cpp:21
Definition: Console.h:100
int parse(int argc, char *argv[])
Definition: Console.cpp:103