FreeNOS
Public Member Functions | Private Attributes
Argument Class Reference

Represents program command line argument. More...

#include <Argument.h>

Public Member Functions

 Argument (const char *name)
 Class constructor. More...
 
 Argument (const String &name)
 Class constructor. More...
 
char getIdentifier () const
 Get single character identifier. More...
 
const StringgetName () const
 Retrieve argument name. More...
 
const StringgetDescription () const
 Retrieve single line argument description. More...
 
const StringgetValue () const
 Retrieve argument option value (if any) More...
 
Size getCount () const
 Retrieve maximum argument count (if set) More...
 
void setIdentifier (char id)
 Set argument identifier. More...
 
void setName (const char *name)
 Set argument name. More...
 
void setDescription (const char *description)
 Set argument single line description. More...
 
void setValue (const char *value)
 Set argument option value. More...
 
void setCount (Size count)
 Set argument maximum count. More...
 
bool operator== (const Argument &arg) const
 Equality operator. More...
 
bool operator!= (const Argument &arg) const
 Non-equality operator. More...
 

Private Attributes

char m_id
 Argument identifier. More...
 
String m_name
 Argument name. More...
 
String m_description
 Argument description in a single line. More...
 
String m_value
 Optional argument value. More...
 
Size m_count
 Maximum argument count. More...
 

Detailed Description

Represents program command line argument.

Definition at line 35 of file Argument.h.

Constructor & Destructor Documentation

◆ Argument() [1/2]

Argument::Argument ( const char *  name)

Class constructor.

Parameters
nameInput argument name

Definition at line 20 of file Argument.cpp.

◆ Argument() [2/2]

Argument::Argument ( const String name)

Class constructor.

Parameters
nameInput argument name

Definition at line 27 of file Argument.cpp.

Member Function Documentation

◆ getCount()

Size Argument::getCount ( ) const

Retrieve maximum argument count (if set)

Returns
Maximum argument count

Definition at line 39 of file Argument.cpp.

References m_count.

Referenced by ArgumentParser::registerPositional().

◆ getDescription()

const String & Argument::getDescription ( ) const

Retrieve single line argument description.

Returns
Argument description

Definition at line 49 of file Argument.cpp.

References m_description.

◆ getIdentifier()

char Argument::getIdentifier ( ) const

Get single character identifier.

Returns
Single character identifier

Definition at line 34 of file Argument.cpp.

References m_id.

◆ getName()

const String & Argument::getName ( ) const

Retrieve argument name.

Returns
Argument name

Definition at line 44 of file Argument.cpp.

References m_name.

Referenced by ArgumentContainer::addFlag(), and ArgumentContainer::get().

◆ getValue()

const String & Argument::getValue ( ) const

Retrieve argument option value (if any)

Returns
Argument value

Definition at line 54 of file Argument.cpp.

References m_value.

Referenced by ArgumentContainer::get().

◆ operator!=()

bool Argument::operator!= ( const Argument arg) const

Non-equality operator.

Parameters
argArgument reference
Returns
Boolean

Definition at line 89 of file Argument.cpp.

References m_id.

◆ operator==()

bool Argument::operator== ( const Argument arg) const

Equality operator.

Parameters
argArgument reference
Returns
Boolean

Definition at line 84 of file Argument.cpp.

References m_id.

◆ setCount()

void Argument::setCount ( Size  count)

Set argument maximum count.

Parameters
countNew argument maximum count

Definition at line 79 of file Argument.cpp.

References m_count.

Referenced by ArgumentParser::registerPositional().

◆ setDescription()

void Argument::setDescription ( const char *  description)

Set argument single line description.

Parameters
descriptionNew argument description

Definition at line 69 of file Argument.cpp.

References m_description.

Referenced by ArgumentParser::registerFlag(), and ArgumentParser::registerPositional().

◆ setIdentifier()

void Argument::setIdentifier ( char  id)

Set argument identifier.

Parameters
idArgument identifier

Definition at line 59 of file Argument.cpp.

References m_id.

Referenced by ArgumentParser::registerFlag().

◆ setName()

void Argument::setName ( const char *  name)

Set argument name.

Parameters
nameNew argument name

Definition at line 64 of file Argument.cpp.

References m_name.

◆ setValue()

void Argument::setValue ( const char *  value)

Set argument option value.

Parameters
valueNew argument option value

Definition at line 74 of file Argument.cpp.

References m_value.

Referenced by ArgumentParser::parse().

Field Documentation

◆ m_count

Size Argument::m_count
private

Maximum argument count.

Definition at line 156 of file Argument.h.

Referenced by getCount(), and setCount().

◆ m_description

String Argument::m_description
private

Argument description in a single line.

Definition at line 150 of file Argument.h.

Referenced by getDescription(), and setDescription().

◆ m_id

char Argument::m_id
private

Argument identifier.

Definition at line 144 of file Argument.h.

Referenced by getIdentifier(), operator!=(), operator==(), and setIdentifier().

◆ m_name

String Argument::m_name
private

Argument name.

Definition at line 147 of file Argument.h.

Referenced by getName(), and setName().

◆ m_value

String Argument::m_value
private

Optional argument value.

Definition at line 153 of file Argument.h.

Referenced by getValue(), and setValue().


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