vishwa | 13555bd | 2015-11-10 12:10:38 -0600 | [diff] [blame] | 1 | #ifndef __ARGUMENT_H |
2 | #define __ARGUMENT_H | ||||
3 | #include <getopt.h> | ||||
Patrick Venture | c9508db | 2018-10-16 17:18:43 -0700 | [diff] [blame] | 4 | |
vishwa | 13555bd | 2015-11-10 12:10:38 -0600 | [diff] [blame] | 5 | #include <map> |
6 | #include <string> | ||||
7 | class ArgumentParser | ||||
8 | { | ||||
Patrick Venture | c9508db | 2018-10-16 17:18:43 -0700 | [diff] [blame] | 9 | public: |
10 | ArgumentParser(int argc, char** argv); | ||||
11 | const std::string& operator[](const std::string& opt); | ||||
vishwa | 13555bd | 2015-11-10 12:10:38 -0600 | [diff] [blame] | 12 | |
Patrick Venture | c9508db | 2018-10-16 17:18:43 -0700 | [diff] [blame] | 13 | static void usage(char** argv); |
vishwa | 13555bd | 2015-11-10 12:10:38 -0600 | [diff] [blame] | 14 | |
Patrick Venture | c9508db | 2018-10-16 17:18:43 -0700 | [diff] [blame] | 15 | static const std::string true_string; |
16 | static const std::string empty_string; | ||||
vishwa | 13555bd | 2015-11-10 12:10:38 -0600 | [diff] [blame] | 17 | |
Patrick Venture | c9508db | 2018-10-16 17:18:43 -0700 | [diff] [blame] | 18 | private: |
19 | std::map<const std::string, std::string> arguments; | ||||
vishwa | 13555bd | 2015-11-10 12:10:38 -0600 | [diff] [blame] | 20 | |
Patrick Venture | c9508db | 2018-10-16 17:18:43 -0700 | [diff] [blame] | 21 | static const option options[]; |
22 | static const char* optionstr; | ||||
vishwa | 13555bd | 2015-11-10 12:10:38 -0600 | [diff] [blame] | 23 | |
Patrick Venture | c9508db | 2018-10-16 17:18:43 -0700 | [diff] [blame] | 24 | private: |
25 | ArgumentParser(){}; | ||||
vishwa | 13555bd | 2015-11-10 12:10:38 -0600 | [diff] [blame] | 26 | }; |
27 | |||||
28 | #endif |