DCCL v3
Public Member Functions | Static Public Member Functions | List of all members
dccl::Option Class Reference

Represents a command line option. More...

#include <dccl/cli_option.h>

Public Member Functions

 Option (char shortname, const char *longname, int has_argument, const std::string &description)
 Create a command line option. More...
 
option c_opt () const
 
std::string opt_code () const
 
std::string usage () const
 

Static Public Member Functions

static void convert_vector (const std::vector< Option > &options, std::vector< option > *c_options, std::string *opt_string)
 Convert a vector of Options into a vector of options (from getopt.h) and an opt_string, suitable for use in getopt_long()
 

Detailed Description

Represents a command line option.

Definition at line 33 of file cli_option.h.

Constructor & Destructor Documentation

dccl::Option::Option ( char  shortname,
const char *  longname,
int  has_argument,
const std::string &  description 
)
inline

Create a command line option.

Parameters
shortnameSingle character representation (e.g. 'v' for "-v")
longnameFull representation (e.g. "verbose" for "--verbose")
has_argumentDoes the parameter take an argument?
descriptionHuman description for the –help option

Definition at line 42 of file cli_option.h.

Member Function Documentation

option dccl::Option::c_opt ( ) const
inline
Returns
Equivalent option from <getopt.h>

Definition at line 56 of file cli_option.h.

std::string dccl::Option::opt_code ( ) const
inline
Returns
option code from <getopt.h> used in getopt_long()

Definition at line 59 of file cli_option.h.

std::string dccl::Option::usage ( ) const
inline
Returns
String giving usage for the –help option.

Definition at line 78 of file cli_option.h.


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