blob: 849ccb57c794dae87e696adc765c64b551dfd3a6 [file] [log] [blame]
vishwa13555bd2015-11-10 12:10:38 -06001#ifndef __ARGUMENT_H
2#define __ARGUMENT_H
3#include <getopt.h>
Patrick Venturec9508db2018-10-16 17:18:43 -07004
vishwa13555bd2015-11-10 12:10:38 -06005#include <map>
6#include <string>
7class ArgumentParser
8{
Patrick Venturec9508db2018-10-16 17:18:43 -07009 public:
10 ArgumentParser(int argc, char** argv);
11 const std::string& operator[](const std::string& opt);
vishwa13555bd2015-11-10 12:10:38 -060012
Patrick Venturec9508db2018-10-16 17:18:43 -070013 static void usage(char** argv);
vishwa13555bd2015-11-10 12:10:38 -060014
Patrick Venturec9508db2018-10-16 17:18:43 -070015 static const std::string true_string;
16 static const std::string empty_string;
vishwa13555bd2015-11-10 12:10:38 -060017
Patrick Venturec9508db2018-10-16 17:18:43 -070018 private:
19 std::map<const std::string, std::string> arguments;
vishwa13555bd2015-11-10 12:10:38 -060020
Patrick Venturec9508db2018-10-16 17:18:43 -070021 static const option options[];
22 static const char* optionstr;
vishwa13555bd2015-11-10 12:10:38 -060023
Patrick Venturec9508db2018-10-16 17:18:43 -070024 private:
25 ArgumentParser(){};
vishwa13555bd2015-11-10 12:10:38 -060026};
27
28#endif