E-MailRelay
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
G::Option Struct Reference

A structure representing a G::Options command-line option. More...

#include <goption.h>

+ Collaboration diagram for G::Option:

Public Types

enum class  Multiplicity {
  zero , zero_or_one , one , many ,
  error
}
 

Public Member Functions

 Option (char c, const std::string &name, const std::string &description, const std::string &description_extra, Multiplicity value_multiplicity, const std::string &vd, unsigned int level)
 Constructor taking strings. More...
 
 Option (char c, const char *name, const char *description, const char *description_extra, Multiplicity value_multiplicity, const char *vd, unsigned int level, unsigned int main_tag, unsigned int tag_bits)
 Constructor taking c-strings and tags. More...
 
bool valued () const
 
bool defaulting () const
 
bool multivalued () const
 
bool visible () const
 
bool visible (std::pair< unsigned, unsigned > level_range, unsigned int main_tag=0U, unsigned int tag_bits=0U) const
 

Static Public Member Functions

static Multiplicity decode (const std::string &)
 Decodes a multiplicity string into its enumeration. More...
 

Public Attributes

char c
 
std::string name
 
std::string description
 
std::string description_extra
 
Multiplicity value_multiplicity
 
bool hidden
 
std::string value_description
 
unsigned int level
 
unsigned int main_tag
 
unsigned int tag_bits
 

Detailed Description

A structure representing a G::Options command-line option.

Definition at line 37 of file goption.h.

Member Enumeration Documentation

◆ Multiplicity

enum class G::Option::Multiplicity
strong

Definition at line 39 of file goption.h.

Constructor & Destructor Documentation

◆ Option() [1/2]

G::Option::Option ( char  c,
const std::string &  name,
const std::string &  description,
const std::string &  description_extra,
Multiplicity  value_multiplicity,
const std::string &  vd,
unsigned int  level 
)

Constructor taking strings.

Definition at line 24 of file goption.cpp.

◆ Option() [2/2]

G::Option::Option ( char  c,
const char *  name,
const char *  description,
const char *  description_extra,
Multiplicity  value_multiplicity,
const char *  vd,
unsigned int  level,
unsigned int  main_tag,
unsigned int  tag_bits 
)

Constructor taking c-strings and tags.

Definition at line 40 of file goption.cpp.

Member Function Documentation

◆ decode()

G::Option::Multiplicity G::Option::decode ( const std::string &  s)
static

Decodes a multiplicity string into its enumeration.

Returns 'error' on error.

Definition at line 57 of file goption.cpp.

◆ defaulting()

bool G::Option::defaulting ( ) const
inline

Definition at line 74 of file goption.h.

◆ multivalued()

bool G::Option::multivalued ( ) const
inline

Definition at line 75 of file goption.h.

◆ valued()

bool G::Option::valued ( ) const
inline

Definition at line 73 of file goption.h.

◆ visible() [1/2]

bool G::Option::visible ( ) const
inline

Definition at line 76 of file goption.h.

◆ visible() [2/2]

bool G::Option::visible ( std::pair< unsigned, unsigned >  level_range,
unsigned int  main_tag = 0U,
unsigned int  tag_bits = 0U 
) const
inline

Definition at line 77 of file goption.h.

Member Data Documentation

◆ c

char G::Option::c

Definition at line 40 of file goption.h.

◆ description

std::string G::Option::description

Definition at line 42 of file goption.h.

◆ description_extra

std::string G::Option::description_extra

Definition at line 43 of file goption.h.

◆ hidden

bool G::Option::hidden

Definition at line 45 of file goption.h.

◆ level

unsigned int G::Option::level

Definition at line 47 of file goption.h.

◆ main_tag

unsigned int G::Option::main_tag

Definition at line 48 of file goption.h.

◆ name

std::string G::Option::name

Definition at line 41 of file goption.h.

◆ tag_bits

unsigned int G::Option::tag_bits

Definition at line 49 of file goption.h.

◆ value_description

std::string G::Option::value_description

Definition at line 46 of file goption.h.

◆ value_multiplicity

Multiplicity G::Option::value_multiplicity

Definition at line 44 of file goption.h.


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