Classes | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Protected Attributes | Friends | List of all members
vul_arg_base Class Referenceabstract

This is the base class for the templated vul_arg<T>s. More...

#include <vul_arg.h>

Inheritance diagram for vul_arg_base:
Inheritance graph
[legend]

Classes

struct  required_option_type
 

Public Member Functions

char const * option ()
 
char const * help ()
 
bool set () const
 Returns true if arg was set on the command line. More...
 
virtual std::ostream & print_value (std::ostream &)=0
 

Static Public Member Functions

static void parse_deprecated (int &argc, char **&argv, bool warn_about_unrecognized_arguments=true)
 The main static method. More...
 
static void include_deprecated (vul_arg_info_list &l)
 Add another vul_arg_info_list to the current one. More...
 
static void add_to_current (vul_arg_base *a)
 
static void set_help_option (char const *str)
 
static void set_help_description (char const *str)
 
static void set_help_precis (char const *str)
 
static void display_usage (char const *msg=nullptr)
 
static void display_usage_and_exit (char const *msg=nullptr)
 

Public Attributes

char const * type_
 Static text describing type of option (e.g. bool or double). More...
 

Static Public Attributes

static VUL_EXPORT required_option_type is_required
 

Protected Member Functions

 vul_arg_base (vul_arg_info_list &l, char const *option_string, char const *helpstring, bool required=false)
 
 vul_arg_base (char const *option_string, char const *helpstring, bool required=false)
 
virtual ~vul_arg_base ()=default
 
virtual int parse (char **argv)=0
 

Protected Attributes

bool set_
 After parsing, true iff value was set on command line. More...
 
bool required_
 if true, this flag must be set on command line. More...
 
std::string option_
 Option flag including "-" or "--". More...
 
std::string help_
 Description of argument. More...
 

Friends

class vul_arg_info_list
 

Detailed Description

This is the base class for the templated vul_arg<T>s.

Definition at line 35 of file vul_arg.h.

Constructor & Destructor Documentation

◆ vul_arg_base() [1/2]

vul_arg_base::vul_arg_base ( vul_arg_info_list l,
char const *  option_string,
char const *  helpstring,
bool  required = false 
)
protected

Definition at line 131 of file vul_arg.cxx.

◆ vul_arg_base() [2/2]

vul_arg_base::vul_arg_base ( char const *  option_string,
char const *  helpstring,
bool  required = false 
)
protected

Definition at line 140 of file vul_arg.cxx.

◆ ~vul_arg_base()

virtual vul_arg_base::~vul_arg_base ( )
protectedvirtualdefault

Member Function Documentation

◆ add_to_current()

void vul_arg_base::add_to_current ( vul_arg_base a)
static

Definition at line 90 of file vul_arg.cxx.

◆ display_usage()

void vul_arg_base::display_usage ( char const *  msg = nullptr)
static

Definition at line 116 of file vul_arg.cxx.

◆ display_usage_and_exit()

void vul_arg_base::display_usage_and_exit ( char const *  msg = nullptr)
static

Definition at line 122 of file vul_arg.cxx.

◆ help()

char const * vul_arg_base::help ( )

Definition at line 47 of file vul_arg.cxx.

◆ include_deprecated()

void vul_arg_base::include_deprecated ( vul_arg_info_list l)
static

Add another vul_arg_info_list to the current one.

This allows for the inclusion of different sets of arguments into the main program, from different libraries.

Definition at line 84 of file vul_arg.cxx.

◆ option()

char const * vul_arg_base::option ( )

Definition at line 44 of file vul_arg.cxx.

◆ parse()

virtual int vul_arg_base::parse ( char **  argv)
protectedpure virtual

Implemented in vul_arg< T >.

◆ parse_deprecated()

void vul_arg_base::parse_deprecated ( int &  argc,
char **&  argv,
bool  warn_about_unrecognized_arguments = true 
)
static

The main static method.

Definition at line 96 of file vul_arg.cxx.

◆ print_value()

virtual std::ostream& vul_arg_base::print_value ( std::ostream &  )
pure virtual

Implemented in vul_arg< T >.

◆ set()

bool vul_arg_base::set ( ) const

Returns true if arg was set on the command line.

Definition at line 72 of file vul_arg.cxx.

◆ set_help_description()

void vul_arg_base::set_help_description ( char const *  str)
static

Definition at line 111 of file vul_arg.cxx.

◆ set_help_option()

void vul_arg_base::set_help_option ( char const *  str)
static

Definition at line 101 of file vul_arg.cxx.

◆ set_help_precis()

void vul_arg_base::set_help_precis ( char const *  str)
static

Definition at line 106 of file vul_arg.cxx.

Friends And Related Function Documentation

◆ vul_arg_info_list

friend class vul_arg_info_list
friend

Definition at line 54 of file vul_arg.h.

Member Data Documentation

◆ help_

std::string vul_arg_base::help_
protected

Description of argument.

Definition at line 77 of file vul_arg.h.

◆ is_required

vul_arg_base::required_option_type vul_arg_base::is_required
static

Definition at line 41 of file vul_arg.h.

◆ option_

std::string vul_arg_base::option_
protected

Option flag including "-" or "--".

Definition at line 75 of file vul_arg.h.

◆ required_

bool vul_arg_base::required_
protected

if true, this flag must be set on command line.

Definition at line 73 of file vul_arg.h.

◆ set_

bool vul_arg_base::set_
protected

After parsing, true iff value was set on command line.

Definition at line 71 of file vul_arg.h.

◆ type_

char const* vul_arg_base::type_

Static text describing type of option (e.g. bool or double).

Definition at line 68 of file vul_arg.h.


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