MOAB: Mesh Oriented datABase
(version 5.4.1)
|
#include <CLArgFlag.hpp>
Public Member Functions | |
virtual | ~CLArgFlag () |
char | flag () const |
const char * | desc () const |
virtual const CLArgs::ArgIBase * | callback () const =0 |
virtual bool | is_toggle () const |
virtual bool | parse (const char *string_value) const =0 |
virtual std::string | brief () const =0 |
virtual std::string | manstr () const =0 |
virtual bool | add_set (int size, const char *const *names) |
std::string | make_man_string (int count, const char *names[]) const |
std::string | make_man_string (const char *arg_name) const |
std::string | make_man_string () const |
std::string | make_literal_man_string (int count, const char *literal_args[]) const |
std::string | make_literal_man_string (const char *literal_args) const |
Protected Member Functions | |
CLArgFlag (char pflag, const char *pdesc) | |
Private Attributes | |
char | mFlag |
std::string | mDesc |
Definition at line 41 of file CLArgFlag.hpp.
CLArgFlag::CLArgFlag | ( | char | pflag, |
const char * | pdesc | ||
) | [inline, protected] |
Definition at line 48 of file CLArgFlag.hpp.
CLArgFlag::~CLArgFlag | ( | ) | [virtual] |
Definition at line 50 of file CLArgFlag.cpp.
{}
bool CLArgFlag::add_set | ( | int | size, |
const char *const * | names | ||
) | [virtual] |
Reimplemented in CLArgDoubleList, and CLArgIntList.
Definition at line 88 of file CLArgFlag.cpp.
Referenced by CLArgs::limit_list_flag().
{ return false; }
virtual std::string CLArgFlag::brief | ( | ) | const [pure virtual] |
Get brief format of option
Implemented in CLArgDoubleList, CLArgIntList, CLArgIDList, CLArgDouble, CLArgInt, CLArgLong, CLArgString, and CLArgToggle.
virtual const CLArgs::ArgIBase* CLArgFlag::callback | ( | ) | const [pure virtual] |
Implemented in CLArgDoubleList, CLArgIntList, CLArgIDList, CLArgDouble, CLArgInt, CLArgLong, CLArgString, and CLArgToggle.
const char* CLArgFlag::desc | ( | ) | const [inline] |
char CLArgFlag::flag | ( | ) | const [inline] |
Definition at line 53 of file CLArgFlag.hpp.
References mFlag.
Referenced by CLArgImpl::add_flag(), CLArgToggle::brief(), CLArgString::brief(), make_literal_man_string(), make_man_string(), CLArgToggle::manstr(), and CLArgs::parse_options().
{ return mFlag; }
bool CLArgFlag::is_toggle | ( | ) | const [virtual] |
Reimplemented in CLArgToggle.
Definition at line 83 of file CLArgFlag.cpp.
Referenced by CLArgs::parse_options().
{ return false; }
std::string CLArgFlag::make_literal_man_string | ( | int | count, |
const char * | literal_args[] | ||
) | const |
Definition at line 69 of file CLArgFlag.cpp.
References ManPage::begin_bold(), ManPage::bold(), ManPage::end_bold(), and flag().
Referenced by make_literal_man_string().
{ std::ostringstream ss; ManPage::begin_bold( ss ) << "-" << flag(); ManPage::end_bold( ss ); if( count ) { ss << args[0]; for( int i = 1; i < count; ++i ) ManPage::bold( ss, args[i] ); } return ss.str(); }
std::string CLArgFlag::make_literal_man_string | ( | const char * | literal_args | ) | const [inline] |
Definition at line 83 of file CLArgFlag.hpp.
References make_literal_man_string().
{ return make_literal_man_string( 1, &literal_args ); }
std::string CLArgFlag::make_man_string | ( | int | count, |
const char * | names[] | ||
) | const |
Definition at line 52 of file CLArgFlag.cpp.
References ManPage::begin_bold(), ManPage::end_bold(), and flag().
{ std::ostringstream ss; ManPage::begin_bold( ss ) << "-" << flag(); ManPage::end_bold( ss ); if( count ) { ss << "<" << names[0]; for( int i = 1; i < count; ++i ) { ss << "|"; } ss << ">"; } return ss.str(); }
std::string CLArgFlag::make_man_string | ( | const char * | arg_name | ) | const [inline] |
Definition at line 74 of file CLArgFlag.hpp.
References make_man_string().
{ return make_man_string( 1, &arg_name ); }
std::string CLArgFlag::make_man_string | ( | ) | const [inline] |
Definition at line 78 of file CLArgFlag.hpp.
Referenced by make_man_string(), and CLArgToggle::manstr().
{ return make_man_string( 0, 0 ); }
virtual std::string CLArgFlag::manstr | ( | ) | const [pure virtual] |
Get UNIX man-page formated synposis of flag
Implemented in CLArgDoubleList, CLArgIntList, CLArgIDList, CLArgDouble, CLArgInt, CLArgLong, CLArgString, and CLArgToggle.
virtual bool CLArgFlag::parse | ( | const char * | string_value | ) | const [pure virtual] |
Implemented in CLArgDoubleList, CLArgIntList, CLArgIDList, CLArgDouble, CLArgInt, CLArgLong, CLArgString, and CLArgToggle.
Referenced by CLArgs::parse_options().
std::string CLArgFlag::mDesc [private] |
Definition at line 45 of file CLArgFlag.hpp.
Referenced by desc().
char CLArgFlag::mFlag [private] |
Definition at line 44 of file CLArgFlag.hpp.
Referenced by flag().