MOAB: Mesh Oriented datABase  (version 5.4.1)
CLArgDouble Class Reference

#include <CLArgFlag.hpp>

+ Inheritance diagram for CLArgDouble:
+ Collaboration diagram for CLArgDouble:

Public Member Functions

 CLArgDouble (char fl, const char *name, const char *pdesc, CLArgs::DoubleArgI *pcallback)
virtual const CLArgs::ArgIBasecallback () const
virtual bool parse (const char *option) const
virtual std::string brief () const
virtual std::string manstr () const

Private Attributes

CLArgs::DoubleArgImCallback
std::string mName

Detailed Description

Definition at line 192 of file CLArgFlag.hpp.


Constructor & Destructor Documentation

CLArgDouble::CLArgDouble ( char  fl,
const char *  name,
const char *  pdesc,
CLArgs::DoubleArgI pcallback 
) [inline]

Definition at line 199 of file CLArgFlag.hpp.

        : CLArgFlag( fl, pdesc ), mCallback( pcallback ), mName( name )
    {
    }

Member Function Documentation

std::string CLArgDouble::brief ( ) const [virtual]

Get brief format of option

Implements CLArgFlag.

Definition at line 218 of file CLArgFlag.cpp.

{
    const char str[] = { '-', flag(), ' ', '<', '\0' };
    std::string result( str );
    result += mName;
    result += ">";
    return result;
}
virtual const CLArgs::ArgIBase* CLArgDouble::callback ( ) const [inline, virtual]

Implements CLArgFlag.

Definition at line 204 of file CLArgFlag.hpp.

References mCallback.

    {
        return mCallback;
    }
std::string CLArgDouble::manstr ( ) const [virtual]

Get UNIX man-page formated synposis of flag

Implements CLArgFlag.

Definition at line 226 of file CLArgFlag.cpp.

{
    return make_man_string( &mName[0] );
}
bool CLArgDouble::parse ( const char *  option) const [virtual]

Implements CLArgFlag.

Definition at line 231 of file CLArgFlag.cpp.

{
    char* endptr;
    double val = strtod( option, &endptr );
    if( *endptr || !mCallback->value( val ) ) return false;
    mCallback->set_seen();
    return true;
}

Member Data Documentation

Definition at line 195 of file CLArgFlag.hpp.

Referenced by callback().

std::string CLArgDouble::mName [private]

Definition at line 196 of file CLArgFlag.hpp.

List of all members.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines