vg
tools for working with variation graphs
|
#include <options.hpp>
Public Member Functions | |
GroupedOptionGroup ()=default | |
GroupedOptionGroup (const GroupedOptionGroup &other)=delete | |
GroupedOptionGroup & | operator= (GroupedOptionGroup &other)=delete |
GroupedOptionGroup (GroupedOptionGroup &&other)=default | |
GroupedOptionGroup & | operator= (GroupedOptionGroup &&other)=default |
virtual | ~GroupedOptionGroup ()=default |
template<typename Receiver > | |
OptionGroup< Receiver > & | add_group (const std::string &heading) |
template<typename Receiver > | |
void | apply (Receiver &receiver) |
Apply all options that go on an object of this type to the given object. More... | |
virtual TickChainLink & | chain (TickChainLink &next) |
Chain through all subgroups. More... | |
virtual bool | parse (int option_id, const char *optarg) |
virtual bool | preset (const BaseValuation &entry) |
virtual bool | set (const BaseValuation &entry) |
virtual bool | query (BaseValuation &entry) const |
virtual void | print_options (ostream &out, bool slug=false) const |
virtual std::vector< std::pair< std::string, std::string > > | get_help () const |
virtual void | make_long_options (std::vector< struct option > &dest) const |
Add options to non-null-terminated input for getopt_long. More... | |
virtual void | make_short_options (std::string &dest) const |
Add options to string input for getopt_long. More... | |
Public Member Functions inherited from vg::subcommand::BaseOptionGroup | |
virtual | ~BaseOptionGroup ()=default |
template<typename T > | |
T | get_option_value (const std::string &option) const |
template<typename T > | |
void | set_option_value (const std::string &option, const T &value) |
Allow the user to manually set an option value. More... | |
Public Member Functions inherited from vg::subcommand::TickChainLink | |
virtual void | reset_chain () |
Reset the chain to its initial values. More... | |
virtual bool | tick_chain () |
virtual std::function< void(const std::function< void(void)> &)> | get_iterator () |
Public Attributes | |
std::vector< std::unique_ptr< BaseOptionGroup > > | subgroups |
Holds all the child groups of options. More... | |
Public Attributes inherited from vg::subcommand::TickChainLink | |
std::function< void(void)> | reset_chain_parent |
This will be called when we want to reset_chain what we are chained onto. More... | |
std::function< bool(void)> | tick_chain_parent |
This will be called when we need to tick_chain our parent. More... | |
Represents a group of groups of options.
Also doubles as the main parser type; you can make one of these and populate it with subgroups and options, and then use get_help() and print_table() to do help, and make_long_options(), make_short_options(), and parse() to parse with getopt_long(), and then you can apply() the options to objects they eventually belong in.
|
default |
|
delete |
|
default |
|
virtualdefault |
|
inline |
Create a new child group with a new heading, which we can add options to.
|
inline |
Apply all options that go on an object of this type to the given object.
|
virtual |
Chain through all subgroups.
Reimplemented from vg::subcommand::TickChainLink.
|
virtual |
Get help, in the form of pairs of options and descriptions. Headings are descriptions without options.
Implements vg::subcommand::BaseOptionGroup.
|
virtual |
Add options to non-null-terminated input for getopt_long.
Implements vg::subcommand::BaseOptionGroup.
|
virtual |
Add options to string input for getopt_long.
Implements vg::subcommand::BaseOptionGroup.
|
default |
|
delete |
|
virtual |
Parse the given option ID, with the given value if needed. Return true if we matched the ID, and false otherwise.
Implements vg::subcommand::BaseOptionGroup.
|
virtual |
Apply a preset value to its option. Returns true if it was found, and false otherwies.
Implements vg::subcommand::BaseOptionGroup.
|
virtual |
Print all options set. By default, prints one option per line. If slug is set, prints short options, all on one line.
Implements vg::subcommand::BaseOptionGroup.
|
virtual |
Fill in entry with the value of the correspondign option, if we have that option. If so, return true.
Implements vg::subcommand::BaseOptionGroup.
|
virtual |
Apply a value to its option. Returns true if it was found, and false otherwies.
Implements vg::subcommand::BaseOptionGroup.
std::vector<std::unique_ptr<BaseOptionGroup> > vg::subcommand::GroupedOptionGroup::subgroups |
Holds all the child groups of options.