MOAB: Mesh Oriented datABase
(version 5.4.1)
|
#include <CLArgFlag.hpp>
Public Member Functions | |
CLArgToggle (char pflag, const char *pdesc, bool value, CLArgs::ToggleArgI *pcallback) | |
CLArgToggle (char pflag, const char *pdesc, CLArgToggle *opposite) | |
virtual const CLArgs::ArgIBase * | callback () const |
virtual bool | is_toggle () const |
virtual bool | parse (const char *option) const |
virtual std::string | brief () const |
virtual std::string | manstr () const |
Private Attributes | |
bool | mValue |
value to pass to callback when flag is encountered | |
CLArgs::ToggleArgI * | mCallback |
CLArgToggle * | mOpposite |
Definition at line 89 of file CLArgFlag.hpp.
CLArgToggle::CLArgToggle | ( | char | pflag, |
const char * | pdesc, | ||
bool | value, | ||
CLArgs::ToggleArgI * | pcallback | ||
) | [inline] |
CLArgToggle::CLArgToggle | ( | char | pflag, |
const char * | pdesc, | ||
CLArgToggle * | opposite | ||
) | [inline] |
std::string CLArgToggle::brief | ( | ) | const [virtual] |
Get brief format of option
Implements CLArgFlag.
Definition at line 102 of file CLArgFlag.cpp.
References CLArgFlag::flag(), and mOpposite.
virtual const CLArgs::ArgIBase* CLArgToggle::callback | ( | ) | const [inline, virtual] |
Implements CLArgFlag.
Definition at line 108 of file CLArgFlag.hpp.
References mCallback.
{ return mCallback; }
virtual bool CLArgToggle::is_toggle | ( | ) | const [inline, virtual] |
std::string CLArgToggle::manstr | ( | ) | const [virtual] |
Get UNIX man-page formated synposis of flag
Implements CLArgFlag.
Definition at line 120 of file CLArgFlag.cpp.
References ManPage::begin_bold(), ManPage::end_bold(), CLArgFlag::flag(), CLArgFlag::make_man_string(), and mOpposite.
{ if( !mOpposite ) { return make_man_string(); } else if( mOpposite->flag() > flag() ) { std::ostringstream result; ManPage::begin_bold( result ); result << "-" << flag(); ManPage::end_bold( result ); result << "|"; ManPage::begin_bold( result ); result << "-" << mOpposite->flag(); ManPage::end_bold( result ); return result.str(); } else { return std::string(); } }
bool CLArgToggle::parse | ( | const char * | option | ) | const [virtual] |
Implements CLArgFlag.
Definition at line 95 of file CLArgFlag.cpp.
References mCallback, mValue, CLArgs::ArgIBase::set_seen(), and CLArgs::ArgTemplateI< T >::value().
CLArgs::ToggleArgI* CLArgToggle::mCallback [private] |
Definition at line 93 of file CLArgFlag.hpp.
Referenced by callback(), and parse().
CLArgToggle* CLArgToggle::mOpposite [private] |
Definition at line 94 of file CLArgFlag.hpp.
Referenced by brief(), CLArgToggle(), and manstr().
bool CLArgToggle::mValue [private] |
value to pass to callback when flag is encountered
Definition at line 92 of file CLArgFlag.hpp.
Referenced by parse().