vg
tools for working with variation graphs
Public Member Functions | List of all members
vg::OptionInterface Class Referenceabstract

#include <option.hpp>

Inheritance diagram for vg::OptionInterface:
vg::BaseOption< Value, OptionValueParser< Value > > vg::BaseOption< vector< Item >, Parser > vg::BaseOption< Value, Parser > vg::Option< Value, Parser > vg::Option< vector< Item >, Parser >

Public Member Functions

virtual const string & get_long_option () const =0
 
virtual const string & get_short_options () const =0
 
virtual const string & get_description () const =0
 
virtual string get_default_value () const =0
 
virtual bool has_argument () const =0
 
virtual void parse ()=0
 
virtual void parse (const string &arg)=0
 
virtual ~OptionInterface ()=default
 

Detailed Description

All of the option templates inherit from this base class, which the command- line parser uses to feed them strings.

Constructor & Destructor Documentation

◆ ~OptionInterface()

virtual vg::OptionInterface::~OptionInterface ( )
virtualdefault

Everyone needs a virtual destructor!

Member Function Documentation

◆ get_default_value()

virtual string vg::OptionInterface::get_default_value ( ) const
pure virtual

Get the default value as a string. May be generated on the fly.

Implemented in vg::BaseOption< Value, Parser >.

◆ get_description()

virtual const string& vg::OptionInterface::get_description ( ) const
pure virtual

Get the description, like "number of foos to bar per frobnitz".

Implemented in vg::BaseOption< Value, Parser >.

◆ get_long_option()

virtual const string& vg::OptionInterface::get_long_option ( ) const
pure virtual

Get the long option text without –, like "foos-to-bar".

Implemented in vg::BaseOption< Value, Parser >.

◆ get_short_options()

virtual const string& vg::OptionInterface::get_short_options ( ) const
pure virtual

Gets a list of short option characters that the option wants, in priority order. If none of these are available, the option will be automatically assigned some other free character.

Implemented in vg::BaseOption< Value, Parser >.

◆ has_argument()

virtual bool vg::OptionInterface::has_argument ( ) const
pure virtual

Returns true if the option takes an argument, and false otherwise.

Implemented in vg::BaseOption< Value, Parser >.

◆ parse() [1/2]

virtual void vg::OptionInterface::parse ( )
pure virtual

Called for no-argument options when the parser encounters them.

Implemented in vg::BaseOption< Value, Parser >, vg::BaseOption< vector< Item >, Parser >, and vg::BaseOption< Value, OptionValueParser< Value > >.

◆ parse() [2/2]

virtual void vg::OptionInterface::parse ( const string &  arg)
pure virtual

Called for argument-having options when the parser encounters them. The passed reference is only valid during the function call, so the option should make a copy.

Implemented in vg::BaseOption< Value, Parser >, vg::BaseOption< vector< Item >, Parser >, and vg::BaseOption< Value, OptionValueParser< Value > >.


The documentation for this class was generated from the following file: