Arg< bool > Class Reference

#include <Pt/Arg.h>

Boolean command-line switch. More...

Public Member Functions

 Arg (bool def=false)
 Constructs with a default value.
 Arg (int &argc, char *argv[], char ch, bool def=false)
 Extracts a short switch from argc and argv.
 Arg (int &argc, char *argv[], const char *str, bool def=false)
 Extracts a long switch from argc and argv.
bool set (int &argc, char *argv[], char ch)
 Extracts a short switch from argc and argv.
bool set (int &argc, char *argv[], const char *str)
 Extracts a long switch from argc and argv.
bool get () const
 Returns the switch value.
 operator bool () const
 Returns the switch value.
const bool & get () const
 Returns the value.
bool isSet () const
 Returns true if the option is set, false if default is used.
const T & get () const
 Returns the value.
bool isSet () const
 Returns true if the option is set, false if default is used.

(Note that these are not member symbols.)

std::ostream & operator<< (std::ostream &out, const Arg< bool > &arg)
 Write Arg to an std::ostream.

Detailed Description

Presence of the flag sets the value to true. Short switches group in one argument, and -x- turns a short switch off. See Arg for the extraction rules.