CAPD DynSys Library 5.2.0
capd::auxil::argelement Class Referenceabstract

This is a helper class which defines common properties of a command-line argument bound with any type of a variable. More...

#include <capd/auxil/arg.h>

Public Member Functions

 argelement (const char *_name)
 The constructor. More...
 
virtual ~argelement ()
 The destructor. More...
 
const char * getname () const
 Returns the name of the command-line argument. More...
 
char * getvalue (char *str)
 Returns the argument's value string from the argument string or returns 0 if it is not this argument. More...
 
virtual int setvalue (char *str, char *next)=0
 Sets the value of this argument according to the string. If necessary, the next argument may be used. Returns: 0 = Ok, -1 = Error, 1 = next used. More...
 
virtual void restore ()=0
 Restores the previous argument value (except for tables). More...
 
virtual void show (std::ostream &out) const =0
 Outputs the argument element to the output stream. More...
 
void resetflags ()
 Resets the flags. More...
 
void set (int flag)
 Sets the given flag. More...
 
void unset (int flag)
 Unsets (clears) the given flag. More...
 
bool get (int flag) const
 Returns the value of the given flag. More...
 

Detailed Description

This is a helper class which defines common properties of a command-line argument bound with any type of a variable.

Constructor & Destructor Documentation

◆ argelement()

capd::auxil::argelement::argelement ( const char *  _name)
inline

The constructor.

◆ ~argelement()

capd::auxil::argelement::~argelement ( )
inlinevirtual

The destructor.

Member Function Documentation

◆ get()

bool capd::auxil::argelement::get ( int  flag) const
inline

Returns the value of the given flag.

◆ getname()

const char * capd::auxil::argelement::getname ( ) const
inline

Returns the name of the command-line argument.

◆ getvalue()

char * capd::auxil::argelement::getvalue ( char *  str)

Returns the argument's value string from the argument string or returns 0 if it is not this argument.

◆ resetflags()

void capd::auxil::argelement::resetflags ( )
inline

Resets the flags.

◆ restore()

virtual void capd::auxil::argelement::restore ( )
pure virtual

Restores the previous argument value (except for tables).

Implemented in capd::auxil::argunit< type >.

◆ set()

void capd::auxil::argelement::set ( int  flag)
inline

Sets the given flag.

◆ setvalue()

virtual int capd::auxil::argelement::setvalue ( char *  str,
char *  next 
)
pure virtual

Sets the value of this argument according to the string. If necessary, the next argument may be used. Returns: 0 = Ok, -1 = Error, 1 = next used.

Implemented in capd::auxil::argunit< type >.

◆ show()

virtual void capd::auxil::argelement::show ( std::ostream &  out) const
pure virtual

Outputs the argument element to the output stream.

Implemented in capd::auxil::argunit< type >.

◆ unset()

void capd::auxil::argelement::unset ( int  flag)
inline

Unsets (clears) the given flag.