Public Types | Public Member Functions | Public Attributes | Private Member Functions | List of all members
vul_arg_info_list Class Reference

a helper for vul_arg::parse. More...

#include <vul_arg.h>

Public Types

enum  autonomy { subset, all }
 

Public Member Functions

 vul_arg_info_list (autonomy autonomy__=subset)
 Construct an empty vul_arg_info_list. More...
 
 ~vul_arg_info_list ()=default
 
void add (vul_arg_base *arg)
 Add an argument to the list. More...
 
void parse (int &argc, char **&argv, bool warn_about_unrecognized_arguments)
 Parse the command line, using the current list of args. More...
 
void include (vul_arg_info_list &l)
 Append another list. The other list is not copied, just pointed to. More...
 
void verbose (bool on)
 
void set_help_option (char const *str)
 Change the help operator (defaults to -?). More...
 
void set_help_precis (char const *str)
 Set the (short) text used to describe the command. More...
 
void set_help_description (char const *str)
 Set the (possibly long) text used to document the command. More...
 
void display_help (char const *progname=nullptr)
 Display help about each option in the arg list. More...
 

Public Attributes

std::vector< vul_arg_base * > args_
 
std::string help_
 
std::string description_
 
std::string command_precis_
 
bool verbose_
 
autonomy autonomy_
 

Private Member Functions

 vul_arg_info_list (vul_arg_info_list const &)
 
vul_arg_info_listoperator= (vul_arg_info_list const &)
 

Detailed Description

a helper for vul_arg::parse.

Users might need it if they wish to parse several command lines.

Definition at line 208 of file vul_arg.h.

Member Enumeration Documentation

◆ autonomy

Enumerator
subset 
all 

Definition at line 211 of file vul_arg.h.

Constructor & Destructor Documentation

◆ vul_arg_info_list() [1/2]

vul_arg_info_list::vul_arg_info_list ( autonomy  autonomy__ = subset)
inline

Construct an empty vul_arg_info_list.

Definition at line 216 of file vul_arg.h.

◆ ~vul_arg_info_list()

vul_arg_info_list::~vul_arg_info_list ( )
default

◆ vul_arg_info_list() [2/2]

vul_arg_info_list::vul_arg_info_list ( vul_arg_info_list const &  )
inlineprivate

Definition at line 248 of file vul_arg.h.

Member Function Documentation

◆ add()

void vul_arg_info_list::add ( vul_arg_base arg)

Add an argument to the list.

Definition at line 167 of file vul_arg.cxx.

◆ display_help()

void vul_arg_info_list::display_help ( char const *  progname = nullptr)

Display help about each option in the arg list.

Note that this function does not exit at the end.

Definition at line 187 of file vul_arg.cxx.

◆ include()

void vul_arg_info_list::include ( vul_arg_info_list l)

Append another list. The other list is not copied, just pointed to.

Definition at line 177 of file vul_arg.cxx.

◆ operator=()

vul_arg_info_list& vul_arg_info_list::operator= ( vul_arg_info_list const &  )
inlineprivate

Definition at line 249 of file vul_arg.h.

◆ parse()

void vul_arg_info_list::parse ( int &  argc,
char **&  argv,
bool  warn_about_unrecognized_arguments 
)

Parse the command line, using the current list of args.

Remove all recognised arguments from the command line by modifying argc and argv.

Definition at line 263 of file vul_arg.cxx.

◆ set_help_description()

void vul_arg_info_list::set_help_description ( char const *  str)
inline

Set the (possibly long) text used to document the command.

It is displayed at the end of the help page.

Definition at line 234 of file vul_arg.h.

◆ set_help_option()

void vul_arg_info_list::set_help_option ( char const *  str)

Change the help operator (defaults to -?).

Definition at line 152 of file vul_arg.cxx.

◆ set_help_precis()

void vul_arg_info_list::set_help_precis ( char const *  str)
inline

Set the (short) text used to describe the command.

Definition at line 230 of file vul_arg.h.

◆ verbose()

void vul_arg_info_list::verbose ( bool  on)
inline

Definition at line 225 of file vul_arg.h.

Member Data Documentation

◆ args_

std::vector<vul_arg_base*> vul_arg_info_list::args_

Definition at line 237 of file vul_arg.h.

◆ autonomy_

autonomy vul_arg_info_list::autonomy_

Definition at line 242 of file vul_arg.h.

◆ command_precis_

std::string vul_arg_info_list::command_precis_

Definition at line 240 of file vul_arg.h.

◆ description_

std::string vul_arg_info_list::description_

Definition at line 239 of file vul_arg.h.

◆ help_

std::string vul_arg_info_list::help_

Definition at line 238 of file vul_arg.h.

◆ verbose_

bool vul_arg_info_list::verbose_

Definition at line 241 of file vul_arg.h.


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