MOAB: Mesh Oriented datABase
(version 5.4.1)
|
#include <CLArgFlag.hpp>
Public Member Functions | |
CLArgDoubleList (char fl, const char *pdesc, CLArgs::DoubleListArgI *pcallback) | |
virtual const CLArgs::ArgIBase * | callback () const |
virtual bool | parse (const char *option) const |
virtual std::string | brief () const |
virtual std::string | manstr () const |
virtual bool | add_set (int size, const char *const *names) |
Private Attributes | |
CLArgListData | listData |
std::string | mName |
CLArgs::DoubleListArgI * | mCallback |
Definition at line 281 of file CLArgFlag.hpp.
CLArgDoubleList::CLArgDoubleList | ( | char | fl, |
const char * | pdesc, | ||
CLArgs::DoubleListArgI * | pcallback | ||
) | [inline] |
Definition at line 289 of file CLArgFlag.hpp.
virtual bool CLArgDoubleList::add_set | ( | int | size, |
const char *const * | names | ||
) | [inline, virtual] |
Reimplemented from CLArgFlag.
Definition at line 303 of file CLArgFlag.hpp.
References CLArgListData::add_set(), and listData.
std::string CLArgDoubleList::brief | ( | ) | const [virtual] |
Get brief format of option
Implements CLArgFlag.
Definition at line 427 of file CLArgFlag.cpp.
{ const char str[] = { '-', flag(), ' ', '\0' }; std::string result( str ); if( listData.accept_any_length() ) result += "<r1,r2,...>"; else result += listData.brief(); return result; }
virtual const CLArgs::ArgIBase* CLArgDoubleList::callback | ( | ) | const [inline, virtual] |
Implements CLArgFlag.
Definition at line 294 of file CLArgFlag.hpp.
References mCallback.
{ return mCallback; }
std::string CLArgDoubleList::manstr | ( | ) | const [virtual] |
Get UNIX man-page formated synposis of flag
Implements CLArgFlag.
Definition at line 440 of file CLArgFlag.cpp.
bool CLArgDoubleList::parse | ( | const char * | option | ) | const [virtual] |
Implements CLArgFlag.
Definition at line 445 of file CLArgFlag.cpp.
{ std::vector< double > list; char* endptr; for( ;; ) { while( isspace( *str ) ) ++str; if( !*str ) break; double d = strtod( str, &endptr ); list.push_back( d ); str = endptr; while( isspace( *str ) ) ++str; if( !*str ) break; if( *str != ',' ) return false; ++str; } if( !listData.acceptable_length( list.size() ) || !mCallback->value( list ) ) return false; mCallback->set_seen(); return true; }
CLArgListData CLArgDoubleList::listData [private] |
Definition at line 284 of file CLArgFlag.hpp.
Referenced by add_set().
CLArgs::DoubleListArgI* CLArgDoubleList::mCallback [private] |
Definition at line 286 of file CLArgFlag.hpp.
Referenced by callback().
std::string CLArgDoubleList::mName [private] |
Definition at line 285 of file CLArgFlag.hpp.