blob: e6acaf3ecd45b2e51aedb75a28a3315d15870d32 [file] [log] [blame]
Brad Bishop26b815f2017-01-04 13:32:47 -05001#pragma once
2
Patrick Williams3667cf32015-10-20 22:39:11 -05003#include <getopt.h>
Patrick Venture043d3232018-08-31 10:10:53 -07004
Patrick Williams3667cf32015-10-20 22:39:11 -05005#include <map>
6#include <string>
7
8class ArgumentParser
9{
Patrick Venture043d3232018-08-31 10:10:53 -070010 public:
11 ArgumentParser(int argc, char** argv);
12 const std::string& operator[](const std::string& opt);
Patrick Williams3667cf32015-10-20 22:39:11 -050013
Patrick Venture043d3232018-08-31 10:10:53 -070014 static void usage(char** argv);
Patrick Williams3667cf32015-10-20 22:39:11 -050015
Patrick Venture043d3232018-08-31 10:10:53 -070016 static const std::string true_string;
17 static const std::string empty_string;
Patrick Williams3667cf32015-10-20 22:39:11 -050018
Patrick Venture043d3232018-08-31 10:10:53 -070019 private:
20 std::map<const std::string, std::string> arguments;
Patrick Williams3667cf32015-10-20 22:39:11 -050021
Patrick Venture043d3232018-08-31 10:10:53 -070022 static const option options[];
23 static const char* optionstr;
Patrick Williams3667cf32015-10-20 22:39:11 -050024
Patrick Venture043d3232018-08-31 10:10:53 -070025 private:
26 ArgumentParser(){};
Patrick Williams3667cf32015-10-20 22:39:11 -050027};
28
Brad Bishop03476f12016-12-19 13:09:12 -050029// vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4