libDwm-0.9.45
Dwm::OptArg Class Reference

Encapsulates a command line option and its argument (if it takes an argument). More...

#include <DwmOptArgs.hh>

Public Member Functions

 OptArg (const std::string &c, const std::string &longName="", bool isRequired=false, const std::string &value="", const std::string &help="")
 
const std::string & Name () const
 Returns the name of the option.
 
const std::string & LongName () const
 Returns the long name for the option.
 
bool IsRequired () const
 Returns whether or not the option is required.
 
bool IsRequired (bool isRequired)
 Sets whether or not the option is required.
 
bool NeedsArg () const
 Returns true if an argument is required for the option.
 
const std::string & Value () const
 Returns the value of the argument.
 
const std::string & Value (const std::string &value)
 Sets and returns the value of the argument.
 
const std::string & Help () const
 Returns the help text for the argument.
 
const std::string & Help (const std::string &help)
 Sets and returns the help text for the argument.
 

Protected Attributes

std::string _name
 
std::string _longName
 
bool _isRequired
 
bool _needsArg
 
std::string _value
 
std::string _help
 

Detailed Description

Encapsulates a command line option and its argument (if it takes an argument).

Like getopt(), an option whose short name is followed by a colon will have an argument. An option whoe short name does not have an argument is a boolean.


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