TTK
Loading...
Searching...
No Matches
Classes | Public Member Functions | Protected Attributes | List of all members
ttk::CommandLineParser Class Reference

Basic command line parsing. More...

#include <CommandLineParser.h>

Inheritance diagram for ttk::CommandLineParser:
ttk::Debug ttk::BaseClass

Classes

class  CommandLineArgument
 

Public Member Functions

 CommandLineParser ()
 
 ~CommandLineParser () override=default
 
int parse (int argc, char **argv)
 
int printArgs (std::ostream &o=std::cout) const
 
int printUsage (const std::string &binPath) const
 
int setOption (const std::string &key, bool *value, const std::string &description="")
 
int setArgument (const std::string &key, double *value, const std::string &description="", const bool &optional=false)
 
int setArgument (const std::string &key, std::vector< double > *value, const std::string &description="", const bool &optional=false)
 
int setArgument (const std::string &key, int *value, const std::string &description="", const bool &optional=false)
 
int setArgument (const std::string &key, std::vector< int > *value, const std::string &description="", const bool &optional=false)
 
int setArgument (const std::string &key, std::string *value, const std::string &description="", const bool &optional=false)
 
int setArgument (const std::string &key, std::vector< std::string > *value, const std::string &description="", const bool &optional=false)
 
- Public Member Functions inherited from ttk::Debug
 Debug ()
 
 ~Debug () override
 
virtual int setDebugLevel (const int &debugLevel)
 
int setWrapper (const Wrapper *wrapper) override
 
int printMsg (const std::string &msg, const debug::Priority &priority=debug::Priority::INFO, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cout) const
 
int printMsg (const std::vector< std::string > &msgs, const debug::Priority &priority=debug::Priority::INFO, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cout) const
 
int printErr (const std::string &msg, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cerr) const
 
int printWrn (const std::string &msg, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cerr) const
 
int printMsg (const std::string &msg, const double &progress, const double &time, const int &threads, const double &memory, const debug::LineMode &lineMode=debug::LineMode::NEW, const debug::Priority &priority=debug::Priority::PERFORMANCE, std::ostream &stream=std::cout) const
 
int printMsg (const std::string &msg, const double &progress, const double &time, const debug::LineMode &lineMode=debug::LineMode::NEW, const debug::Priority &priority=debug::Priority::PERFORMANCE, std::ostream &stream=std::cout) const
 
int printMsg (const std::string &msg, const double &progress, const double &time, const int &threads, const debug::LineMode &lineMode=debug::LineMode::NEW, const debug::Priority &priority=debug::Priority::PERFORMANCE, std::ostream &stream=std::cout) const
 
int printMsg (const std::string &msg, const double &progress, const debug::LineMode &lineMode=debug::LineMode::NEW, const debug::Priority &priority=debug::Priority::PERFORMANCE, std::ostream &stream=std::cout) const
 
int printMsg (const std::string &msg, const double &progress, const debug::Priority &priority, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cout) const
 
int printMsg (const std::vector< std::vector< std::string > > &rows, const debug::Priority &priority=debug::Priority::INFO, const bool hasHeader=true, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cout) const
 
int printMsg (const debug::Separator &separator, const debug::LineMode &lineMode=debug::LineMode::NEW, const debug::Priority &priority=debug::Priority::INFO, std::ostream &stream=std::cout) const
 
int printMsg (const debug::Separator &separator, const debug::Priority &priority, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cout) const
 
int printMsg (const std::string &msg, const debug::Separator &separator, const debug::LineMode &lineMode=debug::LineMode::NEW, const debug::Priority &priority=debug::Priority::INFO, std::ostream &stream=std::cout) const
 
void setDebugMsgPrefix (const std::string &prefix)
 
- Public Member Functions inherited from ttk::BaseClass
 BaseClass ()
 
virtual ~BaseClass ()=default
 
int getThreadNumber () const
 
virtual int setThreadNumber (const int threadNumber)
 

Protected Attributes

std::vector< CommandLineArgumentarguments_
 
- Protected Attributes inherited from ttk::Debug
int debugLevel_
 
std::string debugMsgPrefix_
 
std::string debugMsgNamePrefix_
 
- Protected Attributes inherited from ttk::BaseClass
bool lastObject_
 
int threadNumber_
 
Wrapperwrapper_
 

Additional Inherited Members

- Protected Member Functions inherited from ttk::Debug
int printMsgInternal (const std::string &msg, const std::string &right, const std::string &filler, const debug::Priority &priority=debug::Priority::INFO, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cout) const
 
int printMsgInternal (const std::string &msg, const debug::Priority &priority, const debug::LineMode &lineMode, std::ostream &stream=std::cout) const
 
int welcomeMsg (std::ostream &stream)
 
- Static Protected Attributes inherited from ttk::Debug
static COMMON_EXPORTS debug::LineMode lastLineMode = ttk::debug::LineMode::NEW
 

Detailed Description

Basic command line parsing.

Author
Julien Tierny julie.nosp@m.n.ti.nosp@m.erny@.nosp@m.lip6.nosp@m..fr
Date
September 2013.

Definition at line 14 of file CommandLineParser.h.

Constructor & Destructor Documentation

◆ CommandLineParser()

ttk::CommandLineParser::CommandLineParser ( )
inline

Definition at line 110 of file CommandLineParser.h.

◆ ~CommandLineParser()

ttk::CommandLineParser::~CommandLineParser ( )
overridedefault

Member Function Documentation

◆ parse()

int ttk::CommandLineParser::parse ( int  argc,
char **  argv 
)
inline

Definition at line 123 of file CommandLineParser.h.

◆ printArgs()

int ttk::CommandLineParser::printArgs ( std::ostream &  o = std::cout) const
inline

Definition at line 194 of file CommandLineParser.h.

◆ printUsage()

int ttk::CommandLineParser::printUsage ( const std::string &  binPath) const
inline

Definition at line 268 of file CommandLineParser.h.

◆ setArgument() [1/6]

int ttk::CommandLineParser::setArgument ( const std::string &  key,
double *  value,
const std::string &  description = "",
const bool &  optional = false 
)
inline

Definition at line 313 of file CommandLineParser.h.

◆ setArgument() [2/6]

int ttk::CommandLineParser::setArgument ( const std::string &  key,
int *  value,
const std::string &  description = "",
const bool &  optional = false 
)
inline

Definition at line 349 of file CommandLineParser.h.

◆ setArgument() [3/6]

int ttk::CommandLineParser::setArgument ( const std::string &  key,
std::string *  value,
const std::string &  description = "",
const bool &  optional = false 
)
inline

Definition at line 385 of file CommandLineParser.h.

◆ setArgument() [4/6]

int ttk::CommandLineParser::setArgument ( const std::string &  key,
std::vector< double > *  value,
const std::string &  description = "",
const bool &  optional = false 
)
inline

Definition at line 331 of file CommandLineParser.h.

◆ setArgument() [5/6]

int ttk::CommandLineParser::setArgument ( const std::string &  key,
std::vector< int > *  value,
const std::string &  description = "",
const bool &  optional = false 
)
inline

Definition at line 367 of file CommandLineParser.h.

◆ setArgument() [6/6]

int ttk::CommandLineParser::setArgument ( const std::string &  key,
std::vector< std::string > *  value,
const std::string &  description = "",
const bool &  optional = false 
)
inline

Definition at line 403 of file CommandLineParser.h.

◆ setOption()

int ttk::CommandLineParser::setOption ( const std::string &  key,
bool *  value,
const std::string &  description = "" 
)
inline

Definition at line 296 of file CommandLineParser.h.

Member Data Documentation

◆ arguments_

std::vector<CommandLineArgument> ttk::CommandLineParser::arguments_
protected

Definition at line 422 of file CommandLineParser.h.


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