Brad Bishop | 26b815f | 2017-01-04 13:32:47 -0500 | [diff] [blame] | 1 | #pragma once |
2 | |||||
Patrick Williams | 3667cf3 | 2015-10-20 22:39:11 -0500 | [diff] [blame] | 3 | #include <getopt.h> |
Patrick Venture | 043d323 | 2018-08-31 10:10:53 -0700 | [diff] [blame] | 4 | |
Patrick Williams | 3667cf3 | 2015-10-20 22:39:11 -0500 | [diff] [blame] | 5 | #include <map> |
6 | #include <string> | ||||
7 | |||||
8 | class ArgumentParser | ||||
9 | { | ||||
Patrick Venture | 043d323 | 2018-08-31 10:10:53 -0700 | [diff] [blame] | 10 | public: |
11 | ArgumentParser(int argc, char** argv); | ||||
12 | const std::string& operator[](const std::string& opt); | ||||
Patrick Williams | 3667cf3 | 2015-10-20 22:39:11 -0500 | [diff] [blame] | 13 | |
Patrick Venture | 043d323 | 2018-08-31 10:10:53 -0700 | [diff] [blame] | 14 | static void usage(char** argv); |
Patrick Williams | 3667cf3 | 2015-10-20 22:39:11 -0500 | [diff] [blame] | 15 | |
Patrick Venture | 043d323 | 2018-08-31 10:10:53 -0700 | [diff] [blame] | 16 | static const std::string true_string; |
17 | static const std::string empty_string; | ||||
Patrick Williams | 3667cf3 | 2015-10-20 22:39:11 -0500 | [diff] [blame] | 18 | |
Patrick Venture | 043d323 | 2018-08-31 10:10:53 -0700 | [diff] [blame] | 19 | private: |
20 | std::map<const std::string, std::string> arguments; | ||||
Patrick Williams | 3667cf3 | 2015-10-20 22:39:11 -0500 | [diff] [blame] | 21 | |
Patrick Venture | 043d323 | 2018-08-31 10:10:53 -0700 | [diff] [blame] | 22 | static const option options[]; |
23 | static const char* optionstr; | ||||
Patrick Williams | 3667cf3 | 2015-10-20 22:39:11 -0500 | [diff] [blame] | 24 | |
Patrick Venture | 043d323 | 2018-08-31 10:10:53 -0700 | [diff] [blame] | 25 | private: |
26 | ArgumentParser(){}; | ||||
Patrick Williams | 3667cf3 | 2015-10-20 22:39:11 -0500 | [diff] [blame] | 27 | }; |
28 | |||||
Brad Bishop | 03476f1 | 2016-12-19 13:09:12 -0500 | [diff] [blame] | 29 | // vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4 |