MTK++ Latest version: 0.2.0

Public Member Functions | Protected Member Functions | Protected Attributes
commLineOptions Class Reference

#include <mtkpp/src/Parsers/commLineOptions.h>

List of all members.

Public Member Functions

 commLineOptions ()
 commLineOptions (int maxoptions)
 commLineOptions (int maxoptions, int maxcharoptions)
 ~commLineOptions ()
void setCommandPrefixChar (char _prefix)
void setCommandLongPrefix (char *_prefix)
void setFileCommentChar (char _comment)
void setFileDelimiterChar (char _delimiter)
void useCommandArgs (int _argc, char **_argv)
void useFiileName (const char *_filename)
void noPOSIX ()
void setVerbose ()
void setOption (const char *opt_string)
void setOption (char opt_char)
void setOption (const char *opt_string, char opt_char)
void setFlag (const char *opt_string)
void setFlag (char opt_char)
void setFlag (const char *opt_string, char opt_char)
void setCommandOption (const char *opt_string)
void setCommandOption (char opt_char)
void setCommandOption (const char *opt_string, char opt_char)
void setCommandFlag (const char *opt_string)
void setCommandFlag (char opt_char)
void setCommandFlag (const char *opt_string, char opt_char)
void setFileOption (const char *opt_string)
void setFileOption (char opt_char)
void setFileOption (const char *opt_string, char opt_char)
void setFileFlag (const char *opt_string)
void setFileFlag (char opt_char)
void setFileFlag (const char *opt_string, char opt_char)
void processOptions ()
void processCommandArgs ()
void processCommandArgs (int max_args)
bool processFile ()
void processCommandArgs (int _argc, char **_argv)
void processCommandArgs (int _argc, char **_argv, int max_args)
bool processFile (const char *_filename)
char * getValue (const char *_option)
bool getFlag (const char *_option)
char * getValue (char _optchar)
bool getFlag (char _optchar)
void printUsage ()
void addUsage (const char *line)
void printHelp ()
void noUsage ()
void usageOn ()
int getArgc ()
char * getArgv (int index)

Protected Member Functions

void init ()
void init (int maxopt, int maxcharopt)
bool alloc ()
void cleanup ()
bool valueStoreOK ()
bool doubleOptStorage ()
bool doubleCharStorage ()
bool doubleUsageStorage ()
bool setValue (const char *option, char *value)
bool setFlagOn (const char *option)
bool setValue (char optchar, char *value)
bool setFlagOn (char optchar)
void addOption (const char *option, int type)
void addOption (char optchar, int type)
void addOptionError (const char *opt)
void addOptionError (char opt)
bool findFlag (char *value)
void addUsageError (const char *line)
bool CommandSet ()
bool FileSet ()
bool POSIX ()
bool USAGE ()
char parsePOSIX (char *arg)
int parseGNU (char *arg)
bool matchChar (char c)
int matchOpt (char *opt)
char * readFile ()
char * readFile (const char *fname)
bool consumeFile (char *buffer)
void processLine (char *theline, int length)
char * chomp (char *str)
void valuePairs (char *type, char *value)
void justValue (char *value)
void printVerbose (const char *msg)
void printVerbose (char *msg)
void printVerbose (char ch)
void printVerbose ()

Protected Attributes

int argc
char ** argv
const char * filename
char * appname
int * new_argv
int new_argc
int max_legal_args
int max_options
const char ** options
int * optiontype
int * optionindex
int option_counter
int max_char_options
char * optionchars
int * optchartype
int * optcharindex
int optchar_counter
char ** values
int g_value_counter
const char ** usage
int max_usage_lines
int usage_lines
bool command_set
bool file_set
bool mem_allocated
bool posix_style
bool verbose
bool print_usage
bool print_help
char opt_prefix_char
char long_opt_prefix [MAX_LONG_PREFIX_LENGTH]
char file_delimiter_char
char file_comment_char
char equalsign
char comment
char delimiter
char endofline
char whitespace
char nullterminate
bool set
bool once

Constructor & Destructor Documentation

commLineOptions::commLineOptions ( )
commLineOptions::commLineOptions ( int  maxoptions)
commLineOptions::commLineOptions ( int  maxoptions,
int  maxcharoptions 
)
commLineOptions::~commLineOptions ( )

Member Function Documentation

void commLineOptions::setCommandPrefixChar ( char  _prefix)
void commLineOptions::setCommandLongPrefix ( char *  _prefix)
void commLineOptions::setFileCommentChar ( char  _comment)
void commLineOptions::setFileDelimiterChar ( char  _delimiter)
void commLineOptions::useCommandArgs ( int  _argc,
char **  _argv 
)
void commLineOptions::useFiileName ( const char *  _filename)
void commLineOptions::noPOSIX ( )
void commLineOptions::setVerbose ( )
void commLineOptions::setOption ( const char *  opt_string)

References COMMON_OPT.

Referenced by main().

void commLineOptions::setOption ( char  opt_char)

References COMMON_OPT.

void commLineOptions::setOption ( const char *  opt_string,
char  opt_char 
)

References COMMON_OPT.

void commLineOptions::setFlag ( const char *  opt_string)

References COMMON_FLAG.

Referenced by main().

void commLineOptions::setFlag ( char  opt_char)

References COMMON_FLAG.

void commLineOptions::setFlag ( const char *  opt_string,
char  opt_char 
)

References COMMON_FLAG.

void commLineOptions::setCommandOption ( const char *  opt_string)

References COMMAND_OPT.

void commLineOptions::setCommandOption ( char  opt_char)

References COMMAND_OPT.

void commLineOptions::setCommandOption ( const char *  opt_string,
char  opt_char 
)

References COMMAND_OPT.

void commLineOptions::setCommandFlag ( const char *  opt_string)

References COMMAND_FLAG.

void commLineOptions::setCommandFlag ( char  opt_char)

References COMMAND_FLAG.

void commLineOptions::setCommandFlag ( const char *  opt_string,
char  opt_char 
)

References COMMAND_FLAG.

void commLineOptions::setFileOption ( const char *  opt_string)

References FILE_OPT.

void commLineOptions::setFileOption ( char  opt_char)

References FILE_OPT.

void commLineOptions::setFileOption ( const char *  opt_string,
char  opt_char 
)

References FILE_OPT.

void commLineOptions::setFileFlag ( const char *  opt_string)

References FILE_FLAG.

void commLineOptions::setFileFlag ( char  opt_char)

References FILE_FLAG.

void commLineOptions::setFileFlag ( const char *  opt_string,
char  opt_char 
)

References FILE_FLAG.

void commLineOptions::processOptions ( )
void commLineOptions::processCommandArgs ( )

Referenced by main().

void commLineOptions::processCommandArgs ( int  max_args)
bool commLineOptions::processFile ( )
void commLineOptions::processCommandArgs ( int  _argc,
char **  _argv 
)
void commLineOptions::processCommandArgs ( int  _argc,
char **  _argv,
int  max_args 
)
bool commLineOptions::processFile ( const char *  _filename)
char * commLineOptions::getValue ( const char *  _option)

Referenced by main().

bool commLineOptions::getFlag ( const char *  _option)

Referenced by main().

char * commLineOptions::getValue ( char  _optchar)
bool commLineOptions::getFlag ( char  _optchar)
void commLineOptions::printUsage ( )

Referenced by main().

void commLineOptions::addUsage ( const char *  line)

Referenced by main().

void commLineOptions::printHelp ( )
void commLineOptions::noUsage ( )

Referenced by main().

void commLineOptions::usageOn ( )

Referenced by main().

int commLineOptions::getArgc ( )

Referenced by main().

char * commLineOptions::getArgv ( int  index)

Referenced by main().

void commLineOptions::init ( ) [protected]

References DEFAULT_MAXOPTS.

void commLineOptions::init ( int  maxopt,
int  maxcharopt 
) [protected]

References DEFAULT_MAXUSAGE.

bool commLineOptions::alloc ( ) [protected]
void commLineOptions::cleanup ( ) [protected]
bool commLineOptions::valueStoreOK ( ) [protected]
bool commLineOptions::doubleOptStorage ( ) [protected]
bool commLineOptions::doubleCharStorage ( ) [protected]
bool commLineOptions::doubleUsageStorage ( ) [protected]
bool commLineOptions::setValue ( const char *  option,
char *  value 
) [protected]
bool commLineOptions::setFlagOn ( const char *  option) [protected]

References TRUE_FLAG.

bool commLineOptions::setValue ( char  optchar,
char *  value 
) [protected]
bool commLineOptions::setFlagOn ( char  optchar) [protected]

References TRUE_FLAG.

void commLineOptions::addOption ( const char *  option,
int  type 
) [protected]
void commLineOptions::addOption ( char  optchar,
int  type 
) [protected]
void commLineOptions::addOptionError ( const char *  opt) [protected]
void commLineOptions::addOptionError ( char  opt) [protected]
bool commLineOptions::findFlag ( char *  value) [protected]

References TRUE_FLAG.

void commLineOptions::addUsageError ( const char *  line) [protected]
bool commLineOptions::CommandSet ( ) [protected]
bool commLineOptions::FileSet ( ) [protected]
bool commLineOptions::POSIX ( ) [protected]
bool commLineOptions::USAGE ( ) [protected]
char commLineOptions::parsePOSIX ( char *  arg) [protected]
int commLineOptions::parseGNU ( char *  arg) [protected]
bool commLineOptions::matchChar ( char  c) [protected]
int commLineOptions::matchOpt ( char *  opt) [protected]
char * commLineOptions::readFile ( ) [protected]
char * commLineOptions::readFile ( const char *  fname) [protected]
bool commLineOptions::consumeFile ( char *  buffer) [protected]
void commLineOptions::processLine ( char *  theline,
int  length 
) [protected]
char * commLineOptions::chomp ( char *  str) [protected]
void commLineOptions::valuePairs ( char *  type,
char *  value 
) [protected]

References COMMON_OPT, and FILE_OPT.

void commLineOptions::justValue ( char *  value) [protected]

References COMMON_FLAG, and FILE_FLAG.

void commLineOptions::printVerbose ( const char *  msg) [protected]
void commLineOptions::printVerbose ( char *  msg) [protected]
void commLineOptions::printVerbose ( char  ch) [protected]
void commLineOptions::printVerbose ( ) [protected]

Member Data Documentation

int commLineOptions::argc [protected]
char** commLineOptions::argv [protected]
const char* commLineOptions::filename [protected]
char* commLineOptions::appname [protected]
int* commLineOptions::new_argv [protected]
int commLineOptions::new_argc [protected]
const char** commLineOptions::options [protected]
int* commLineOptions::optiontype [protected]
int* commLineOptions::optionindex [protected]
char* commLineOptions::optionchars [protected]
int* commLineOptions::optchartype [protected]
char** commLineOptions::values [protected]
const char** commLineOptions::usage [protected]
bool commLineOptions::command_set [protected]
bool commLineOptions::file_set [protected]
bool commLineOptions::posix_style [protected]
bool commLineOptions::verbose [protected]
bool commLineOptions::print_usage [protected]
bool commLineOptions::print_help [protected]
char commLineOptions::long_opt_prefix[MAX_LONG_PREFIX_LENGTH] [protected]
char commLineOptions::equalsign [protected]
char commLineOptions::comment [protected]
char commLineOptions::delimiter [protected]
char commLineOptions::endofline [protected]
char commLineOptions::whitespace [protected]
bool commLineOptions::set [protected]
bool commLineOptions::once [protected]

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

Generated on Fri Dec 23 2011 09:28:54 for MTK++ by Doxygen 1.7.5.1