Electroneum
el::base::utils::CommandLineArgs Class Reference

Command line arguments for application if specified using el::Helpers::setArgs(..) or START_EASYLOGGINGPP(..) More...

#include <easylogging++.h>

Public Member Functions

 CommandLineArgs (void)
 
 CommandLineArgs (int argc, const char **argv)
 
 CommandLineArgs (int argc, char **argv)
 
virtual ~CommandLineArgs (void)
 
void setArgs (int argc, const char **argv)
 Sets arguments and parses them. More...
 
void setArgs (int argc, char **argv)
 Sets arguments and parses them. More...
 
bool hasParamWithValue (const char *paramKey) const
 Returns true if arguments contain paramKey with a value (seperated by '=') More...
 
const char * getParamValue (const char *paramKey) const
 Returns value of arguments. More...
 
bool hasParam (const char *paramKey) const
 Return true if arguments has a param (not having a value) i,e without '='. More...
 
bool empty (void) const
 Returns true if no params available. This exclude argv[0]. More...
 
std::size_t size (void) const
 Returns total number of arguments. This exclude argv[0]. More...
 

Friends

base::type::ostream_toperator<< (base::type::ostream_t &os, const CommandLineArgs &c)
 

Detailed Description

Command line arguments for application if specified using el::Helpers::setArgs(..) or START_EASYLOGGINGPP(..)

Definition at line 1234 of file easylogging++.h.

Constructor & Destructor Documentation

◆ CommandLineArgs() [1/3]

el::base::utils::CommandLineArgs::CommandLineArgs ( void  )
inline

Definition at line 1236 of file easylogging++.h.

1236  {
1237  setArgs(0, static_cast<char**>(nullptr));
1238  }
void setArgs(int argc, const char **argv)
Sets arguments and parses them.
Here is the call graph for this function:

◆ CommandLineArgs() [2/3]

el::base::utils::CommandLineArgs::CommandLineArgs ( int  argc,
const char **  argv 
)
inline

Definition at line 1239 of file easylogging++.h.

1239  {
1240  setArgs(argc, argv);
1241  }
void setArgs(int argc, const char **argv)
Sets arguments and parses them.
Here is the call graph for this function:

◆ CommandLineArgs() [3/3]

el::base::utils::CommandLineArgs::CommandLineArgs ( int  argc,
char **  argv 
)
inline

Definition at line 1242 of file easylogging++.h.

1242  {
1243  setArgs(argc, argv);
1244  }
void setArgs(int argc, const char **argv)
Sets arguments and parses them.
Here is the call graph for this function:

◆ ~CommandLineArgs()

virtual el::base::utils::CommandLineArgs::~CommandLineArgs ( void  )
inlinevirtual

Definition at line 1245 of file easylogging++.h.

1245 {}

Member Function Documentation

◆ empty()

bool el::base::utils::CommandLineArgs::empty ( void  ) const

Returns true if no params available. This exclude argv[0].

◆ getParamValue()

const char* el::base::utils::CommandLineArgs::getParamValue ( const char *  paramKey) const

Returns value of arguments.

See also
hasParamWithValue(const char*)

◆ hasParam()

bool el::base::utils::CommandLineArgs::hasParam ( const char *  paramKey) const

Return true if arguments has a param (not having a value) i,e without '='.

◆ hasParamWithValue()

bool el::base::utils::CommandLineArgs::hasParamWithValue ( const char *  paramKey) const

Returns true if arguments contain paramKey with a value (seperated by '=')

◆ setArgs() [1/2]

void el::base::utils::CommandLineArgs::setArgs ( int  argc,
const char **  argv 
)
inline

Sets arguments and parses them.

Definition at line 1247 of file easylogging++.h.

1247  {
1248  setArgs(argc, const_cast<char**>(argv));
1249  }
void setArgs(int argc, const char **argv)
Sets arguments and parses them.
Here is the caller graph for this function:

◆ setArgs() [2/2]

void el::base::utils::CommandLineArgs::setArgs ( int  argc,
char **  argv 
)

Sets arguments and parses them.

◆ size()

std::size_t el::base::utils::CommandLineArgs::size ( void  ) const

Returns total number of arguments. This exclude argv[0].

Friends And Related Function Documentation

◆ operator<<

base::type::ostream_t& operator<< ( base::type::ostream_t os,
const CommandLineArgs c 
)
friend

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