powerd++  0.4.4
Classes | Functions
nih Namespace Reference

Not invented here namespace, for code that substitutes already commonly available functionality. More...

Classes

struct  enum_has_members
 Tests whether the given enum provides all the required definitions. More...
 
class  Options
 An instance of this class offers operators to retrieve command line options and arguments. More...
 
struct  Parameter
 Container for an option definition. More...
 

Functions

template<class OptionT >
size_t argCount (Parameter< OptionT > const &def)
 Retrieves the count of arguments in an option definition. More...
 

Detailed Description

Not invented here namespace, for code that substitutes already commonly available functionality.


Class Documentation

◆ nih::Parameter

struct nih::Parameter

template<class OptionT>
struct nih::Parameter< OptionT >

Container for an option definition.

Aliases can be defined by creating definitions with the same option member.

The lparam, args and usage members have to be 0 terminated, using string literals is safe.

Template Parameters
OptionTAn enum or enum class representing the available options
Class Members
const char * args A comma separated list of arguments.

Set to nullptr or "" if no argument is available.

const char * lparam The long version of this parameter.

Set to nullptr or "" if no long parameter is available.

OptionT option The enum value to return for this option.
char sparam The short version of this parameter.

Set to 0 if no short parameter is available.

const char * usage A usage string.

Function Documentation

◆ argCount()

template<class OptionT >
size_t nih::argCount ( Parameter< OptionT > const &  def)

Retrieves the count of arguments in an option definition.

Template Parameters
OptionTAn enum or enum class representing the available options
Parameters
defThe parameter definition
Returns
The number of arguments specified in the given definition