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

#include <CLArgFlag.hpp>

+ Inheritance diagram for CLArgLong:
+ Collaboration diagram for CLArgLong:

Public Member Functions

 CLArgLong (char fl, const char *name, const char *pdesc, CLArgs::LongArgI *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::LongArgImCallback
std::string mName

Detailed Description

Definition at line 146 of file CLArgFlag.hpp.


Constructor & Destructor Documentation

CLArgLong::CLArgLong ( char  fl,
const char *  name,
const char *  pdesc,
CLArgs::LongArgI pcallback 
) [inline]

Definition at line 153 of file CLArgFlag.hpp.

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

Member Function Documentation

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

Get brief format of option

Implements CLArgFlag.

Definition at line 167 of file CLArgFlag.cpp.

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

Implements CLArgFlag.

Definition at line 158 of file CLArgFlag.hpp.

References mCallback.

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

Get UNIX man-page formated synposis of flag

Implements CLArgFlag.

Definition at line 175 of file CLArgFlag.cpp.

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

Implements CLArgFlag.

Definition at line 180 of file CLArgFlag.cpp.

{
    long l;
    char* end_ptr;
    l = strtol( option, &end_ptr, 0 );
    if( *end_ptr || !mCallback->value( l ) ) return false;
    mCallback->set_seen();
    return true;
}

Member Data Documentation

Definition at line 149 of file CLArgFlag.hpp.

Referenced by callback().

std::string CLArgLong::mName [private]

Definition at line 150 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