Public Types | |
typedef bool(HandlerType::* | Handler )(const NOpt &) |
Option handler type definition. | |
Public Member Functions | |
NOpt (void) | |
Creates a NOpt object. | |
NOpt (const NString &opt_short, const NString &opt_long, bool opt_opt, const NString &help, Handler handler) | |
Creates a NOpt object. | |
~NOpt () | |
Destroys a NOpt object. | |
void | setShort (const NString &opt_short) |
Sets the identifier for the short option. | |
NString | getShort (void) const |
Gets the identifier for the short option. | |
void | setLong (const NString &opt_long) |
Sets the long option name. | |
NString | getLong (void) const |
Gets the long option name. | |
void | setOpt (bool opt_opt) |
Sets whether the option is required or not. | |
bool | hasOpt (void) const |
Gets whether the option is required or not. | |
void | setHelp (const NString &help) |
Sets a help text for the option. | |
NString | getHelp (void) const |
Gets the help text for the option. | |
void | addValue (const NString &value) |
Adds a value to the values list. | |
void | addValues (const NList< NString > &values) |
Adds a set of values to the values list. | |
NList< NString > | getValues (void) const |
Gets the list of values of the option. | |
void | setHandler (NOpt< HandlerType >::Handler handle) |
Sets the handler for the option. | |
Handler | getHandler (void) const |
Gets the handler for te option. | |
bool | isNull (void) const |
Tests whether the object is null or not. | |
void | setRequired (bool required) |
Sets whether this option is required. | |
bool | getRequired (void) const |
Gets whether this options is required. | |
bool | operator== (const NOpt &rhs) const |
Tests whether the object equals another object. | |
bool | operator!= (const NOpt &rhs) const |
Tests whether the object is different than another object. |
clientapp.cpp, ex_ndir.cpp, ex_nfileinfo.cpp, ex_ngetopt.cpp, ex_nregex.cpp, hashapp.cpp, nsqlapp.cpp, xmlreader.cpp, and xmlreader.h.
Definition at line 37 of file nopt.hpp.
NOpt | ( | const NString & | opt_short, | |
const NString & | opt_long, | |||
bool | opt_opt, | |||
const NString & | help, | |||
Handler | handler | |||
) | [inline] |
Creates a NOpt object.
opt_short | A letter identifying the option | |
opt_long | A long option name or "" in case it doesn't exist | |
opt_opt | A boolean value indicating whether the option is required or not | |
help | A help text describing the option and its arguments | |
handler | The handler method for the option |
void setShort | ( | const NString & | opt_short | ) | [inline] |
NString getShort | ( | void | ) | const [inline] |
Gets the identifier for the short option.
Definition at line 241 of file nopt.hpp.
Referenced by NGetOpt::add(), operator!=(), and operator==().
void setLong | ( | const NString & | opt_long | ) | [inline] |
NString getLong | ( | void | ) | const [inline] |
Gets the long option name.
Definition at line 253 of file nopt.hpp.
Referenced by NGetOpt::add(), operator!=(), and operator==().
void setOpt | ( | bool | opt_opt | ) | [inline] |
bool hasOpt | ( | void | ) | const [inline] |
Gets whether the option is required or not.
Definition at line 265 of file nopt.hpp.
Referenced by NGetOpt::proccess().
void setHelp | ( | const NString & | help | ) | [inline] |
NString getHelp | ( | void | ) | const [inline] |
void addValue | ( | const NString & | value | ) | [inline] |
Adds a value to the values list.
value | The value to be added |
Definition at line 284 of file nopt.hpp.
References NList::append().
Adds a set of values to the values list.
values | A NList<NString> object containing a list of values |
Definition at line 290 of file nopt.hpp.
References NList::copy().
Gets the handler for te option.
Definition at line 308 of file nopt.hpp.
Referenced by NGetOpt::proccess().
bool isNull | ( | void | ) | const [inline] |
Tests whether the object is null or not.
Definition at line 314 of file nopt.hpp.
Referenced by NGetOpt::proccess().
void setRequired | ( | bool | required | ) |
Sets whether this option is required.
required | True if it's required or false otherwise |
bool getRequired | ( | void | ) | const |
Gets whether this options is required.
bool operator== | ( | const NOpt< HandlerType > & | rhs | ) | const [inline] |
Tests whether the object equals another object.
rhs | The object to test against |
Definition at line 324 of file nopt.hpp.
References getLong(), and getShort().
bool operator!= | ( | const NOpt< HandlerType > & | rhs | ) | const [inline] |
Tests whether the object is different than another object.
rhs | The object to test against |
Definition at line 347 of file nopt.hpp.
References getLong(), and getShort().