21 #ifndef DATATOOLS_UI_BASE_COMMAND_H 22 #define DATATOOLS_UI_BASE_COMMAND_H 31 #include <boost/optional.hpp> 32 #include <boost/program_options.hpp> 33 #include <boost/cstdint.hpp> 45 class base_command_interface;
54 typedef boost::program_options::options_description
opts_type;
55 typedef boost::program_options::positional_options_description
args_type;
56 typedef boost::program_options::variables_map
vmap_type;
59 virtual bool is_name_valid(
const std::string & candidate_name_)
const;
66 const std::string & description_ =
"",
136 int operator()(
const std::vector<std::string> & argv_,
138 uint32_t flags_ = 0);
142 operator()(
const std::vector<std::string> & argv_,
143 uint32_t flags_ = 0);
146 void call(
const std::vector<std::string> & argv_,
148 uint32_t flags_ = 0);
151 void print_usage(std::ostream & out_, uint32_t flags_ = 0)
const;
154 void print_version(std::ostream & out_, uint32_t flags_ = 0)
const;
157 virtual void tree_dump(std::ostream & out_ = std::clog,
158 const std::string & title_ =
"",
159 const std::string & indent_ =
"",
160 bool inherit_ =
false)
const;
168 virtual void _fini();
171 uint32_t flags_ = 0) = 0;
180 uint32_t flags_ = 0);
190 void _alloc_opts(
const std::string & opts_title_ =
"Allowed options");
232 #endif // DATATOOLS_UI_BASIC_COMMAND_H