CLI for C++ Project Page CLI for C++ Home Page

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

CLI::Options Class Reference

A container for Option instances that defines the command-line options of a given program. More...

#include <Options.h>

List of all members.

Public Types

typedef std::vector< OptionVector

Public Member Functions

 Options ()
 Options (const Options &)
Optionsoperator= (const Options &)
 ~Options ()
void addOption (const Option &option)
 Add the specified option to the container.
void addOption (const char *const option, const bool hasArg, const char *const usage)
 Create and add option a new option to the container.
void addOption (const char *const option, const char *const longOption, const bool hasArg, const char *const usage)
bool hasOption (const char *const which) const
const OptiongetOption (const char *const which) const
std::string toString () const
const Vectoroperator() () const


Detailed Description

A container for Option instances that defines the command-line options of a given program.

Create an instance of this container to define the options for your program.

Author:
John Poplett
Version:
1.0
See also:
CLI::BasicParser


Member Typedef Documentation

typedef std::vector<Option> CLI::Options::Vector
 


Constructor & Destructor Documentation

CLI::Options::Options  ) 
 

CLI::Options::Options const Options  ) 
 

CLI::Options::~Options  ) 
 


Member Function Documentation

void CLI::Options::addOption const char *const   option,
const char *const   longOption,
const bool  hasArg,
const char *const   usage
 

void CLI::Options::addOption const char *const   option,
const bool  hasArg,
const char *const   usage
 

Create and add option a new option to the container.

Use this method to create an option with a short option switch only.

Parameters:
option name of the short option
hasArg specify if this option takes an argument
usage description of argument

void CLI::Options::addOption const Option option  ) 
 

Add the specified option to the container.

const Option& CLI::Options::getOption const char *const   which  )  const
 

bool CLI::Options::hasOption const char *const   which  )  const
 

const Vector& CLI::Options::operator()  )  const
 

Options& CLI::Options::operator= const Options  ) 
 

std::string CLI::Options::toString  )  const
 


The documentation for this class was generated from the following file:
SourceForge Logo hosts this site. Send comments to:
John Poplett