|
vg
tools for working with variation graphs
|
#include <options.hpp>
Public Member Functions | |
| ArgSpec (const std::string &option, char short_option, T Receiver::*dest, const T &default_value, const std::string &help, const ValidatorFunction< T > &validator) | |
| Make an option with a long and short option name. | |
| ArgSpec (const std::string &option, T Receiver::*dest, const T &default_value, const std::string &help, const ValidatorFunction< T > &validator) | |
| Make an option with a long option name only. | |
| virtual | ~ArgSpec ()=default |
| virtual void | set_value (const T &value)=0 |
| Allow setting our stored value. | |
| virtual T | get_value () const =0 |
| And getting our current effective value. | |
| virtual bool | was_set () const =0 |
| Return true if a value has been set from parsing or a preset. | |
| virtual void | preset (const BaseValuation &entry) |
| virtual void | set (const BaseValuation &entry) |
| virtual void | query (BaseValuation &entry) const |
Public Member Functions inherited from vg::subcommand::BaseArgSpec< Receiver > | |
| BaseArgSpec (const std::string &option, char short_option, const std::string &help) | |
| Make an option with a long and short option name. | |
| BaseArgSpec (const std::string &option, const std::string &help) | |
| Make an option with a long option name only. | |
| virtual | ~BaseArgSpec ()=default |
| virtual void | parse (const char *optarg)=0 |
| virtual void | apply (Receiver &receiver) const =0 |
| Apply the value to the right field of the given object. | |
| virtual void | print_value (ostream &out, const char *sep="") const =0 |
| Print value to the given stream after the given separator. | |
| virtual void | print_metavar (ostream &out, const char *sep="") const =0 |
| Print value metavar placeholder to the given stream after the given separator. | |
| virtual void | print_default (ostream &out) const =0 |
| Print default value to the given stream, if appropriate. | |
| virtual void | print (ostream &out, const char *sep="", const char *after="", bool slug=false) const |
| virtual struct option | get_option_struct () const =0 |
| Get the getopt structure for this option. Option must outlive it and not move. | |
Public Member Functions inherited from vg::subcommand::TickChainLink | |
| virtual void | reset_chain () |
| Reset the chain to its initial values. | |
| virtual bool | tick_chain () |
| virtual TickChainLink & | chain (TickChainLink &next) |
| virtual std::function< void(const std::function< void(void)> &)> | get_iterator () |
Public Attributes | |
| T Receiver::* | dest |
| Field in the receiving type we set. | |
| T | default_value |
| Original default value. | |
| ValidatorFunction< T > | validator |
| Function to check value with. | |
Public Attributes inherited from vg::subcommand::BaseArgSpec< Receiver > | |
| std::string | option |
| Name of the option (long opt) | |
| std::string | help |
| Help for the option. | |
| char | short_option |
| Character of the option (short opt), or 0. | |
| int | option_id |
| Int value to represent the option. | |
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. | |
| std::function< bool(void)> | tick_chain_parent |
| This will be called when we need to tick_chain our parent. | |
Interface for a command-line argument that corresponds to a value of a given type. Storage method is left to be implemented by inheritor.
|
inline |
Make an option with a long and short option name.
|
inline |
Make an option with a long option name only.
|
virtualdefault |
|
pure virtual |
And getting our current effective value.
Implemented in vg::subcommand::ValueArgSpec< T, Receiver, Holder >, vg::subcommand::ValueArgSpec< bool, Receiver >, and vg::subcommand::ValueArgSpec< T, Receiver, Range< T > >.
|
inlinevirtual |
Apply a preset item, or fail if it doesn't match. The preset value will sit under any parsed value but above the default.
Implements vg::subcommand::BaseArgSpec< Receiver >.
|
inlinevirtual |
Put our current effective value into the given BaseValuation, which must be for the right option and have the right type.
Implements vg::subcommand::BaseArgSpec< Receiver >.
|
inlinevirtual |
Apply a valuation, or fail if it doesn't match. The value will replace any parsed value! Validation will not be run!
Implements vg::subcommand::BaseArgSpec< Receiver >.
|
pure virtual |
Allow setting our stored value.
Implemented in vg::subcommand::ValueArgSpec< T, Receiver, Holder >, and vg::subcommand::ValueArgSpec< T, Receiver, Range< T > >.
|
pure virtual |
Return true if a value has been set from parsing or a preset.
Implemented in vg::subcommand::ValueArgSpec< T, Receiver, Holder >, vg::subcommand::ValueArgSpec< bool, Receiver >, and vg::subcommand::ValueArgSpec< T, Receiver, Range< T > >.
| T vg::subcommand::ArgSpec< T, Receiver >::default_value |
Original default value.
| T Receiver::* vg::subcommand::ArgSpec< T, Receiver >::dest |
Field in the receiving type we set.
| ValidatorFunction<T> vg::subcommand::ArgSpec< T, Receiver >::validator |
Function to check value with.
1.9.8