PUMA Library Reference Manual
Puma::ConfOption Class Reference

#include <Puma/ConfOption.h>

Description

Configuration option abstraction. A configuration option has a name and an optional list of arguments. System priority configuration options have a lower priority than non-system options.

Public Member Functions

 ConfOption (const char *option, bool system=false)
 Constructor. More...
 
 ConfOption (const char *option, const char *arg, bool system=false)
 Constructor. More...
 
 ConfOption (const char *option, const char *arg1, const char *arg2, bool system=false)
 Constructor. More...
 
 ~ConfOption ()
 Destroy this option. More...
 
bool isSystem () const
 Check if the option is an system priority option. More...
 
const char * Name () const
 Get the name of the option. More...
 
unsigned int Hash () const
 Get the hash value of the option's name. More...
 
unsigned Arguments () const
 Get the number of option arguments. More...
 
const char * Argument (unsigned n) const
 Get the n-th option argument. More...
 
void addArgument (const char *arg)
 Add a further option argument. More...
 

Constructor & Destructor Documentation

◆ ConfOption() [1/3]

Puma::ConfOption::ConfOption ( const char *  option,
bool  system = false 
)
inline

Constructor.

Parameters
optionThe full name of the option.
systemHas system priority or not.

◆ ConfOption() [2/3]

Puma::ConfOption::ConfOption ( const char *  option,
const char *  arg,
bool  system = false 
)
inline

Constructor.

Parameters
optionThe full name of the option.
argThe argument value of the option.
systemHas system priority or not.

◆ ConfOption() [3/3]

Puma::ConfOption::ConfOption ( const char *  option,
const char *  arg1,
const char *  arg2,
bool  system = false 
)
inline

Constructor.

Parameters
optionThe full name of the option.
arg1The first argument value of the option.
arg2The second argument value of the option.
systemHas system priority or not.

◆ ~ConfOption()

Puma::ConfOption::~ConfOption ( )
inline

Destroy this option.

Member Function Documentation

◆ addArgument()

void Puma::ConfOption::addArgument ( const char *  arg)
inline

Add a further option argument.

Parameters
argThe argument value.

◆ Argument()

const char * Puma::ConfOption::Argument ( unsigned  n) const
inline

Get the n-th option argument.

Parameters
nThe index of the argument to get.
Returns
The n-th argument.

◆ Arguments()

unsigned Puma::ConfOption::Arguments ( ) const
inline

Get the number of option arguments.

Returns
The number of arguments.

◆ Hash()

unsigned int Puma::ConfOption::Hash ( ) const
inline

Get the hash value of the option's name.

Allows faster comparison when searching for this option.

Returns
The hash value.

◆ isSystem()

bool Puma::ConfOption::isSystem ( ) const
inline

Check if the option is an system priority option.

Returns
True if a system priority option.

◆ Name()

const char * Puma::ConfOption::Name ( ) const
inline

Get the name of the option.

Returns
The full name of the option.