6 #ifndef OPTIONPARSER_HPP_INCLUDE
7 #define OPTIONPARSER_HPP_INCLUDE
14 #include "geopm/Exception.hpp"
15 #include "geopm_public.h"
23 std::ostream &std_out,
24 std::ostream &err_out);
26 std::ostream &std_out,
27 std::ostream &err_out,
28 const std::string &custom_help);
30 void add_option(
const std::string &name,
32 const std::string &long_form,
33 const std::string &default_val,
34 const std::string &description);
35 void add_option(
const std::string &name,
37 const std::string &long_form,
38 const char *default_val,
39 const std::string &description);
41 void add_option(
const std::string &name,
43 const std::string &long_form,
45 const std::string &description);
48 bool parse(
int argc,
const char *
const argv[]);
50 bool is_set(
const std::string &name);
52 std::string get_value(
const std::string &name);
54 std::vector<std::string> get_positional_args(
void);
57 void add_example_usage(
const std::string &example);
60 std::string format_help(
void);
63 check_add_option(
const std::string &name,
65 const std::string &long_form);
67 format_option(std::ostream &tmp,
68 const std::string &short_form,
69 const std::string &long_form,
70 std::string description);
72 static const std::string M_COPYRIGHT_TEXT;
74 std::string m_prog_name;
75 std::ostream &m_std_out;
76 std::ostream &m_err_out;
77 std::string m_custom_help;
78 std::vector<std::string> m_example_usage;
79 std::vector<std::string> m_option_order;
85 std::string long_form;
88 std::string description;
90 std::map<std::string, struct m_opt_parse_s<bool> > m_bool_opts;
91 std::map<std::string, struct m_opt_parse_s<std::string> > m_str_opts;
92 std::map<char, std::string> m_bool_short_name;
93 std::map<char, std::string> m_str_short_name;
95 std::vector<std::string> m_positional_args;
Definition: OptionParser.hpp:20
Definition: Accumulator.cpp:12