MOAB: Mesh Oriented datABase  (version 5.3.1)
CLArgInt Class Reference

#include <CLArgFlag.hpp>

+ Inheritance diagram for CLArgInt:
+ Collaboration diagram for CLArgInt:

Public Member Functions

 CLArgInt (char fl, const char *name, const char *pdesc, CLArgs::IntArgI *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::IntArgImCallback
std::string mName

Detailed Description

Definition at line 169 of file CLArgFlag.hpp.


Constructor & Destructor Documentation

CLArgInt::CLArgInt ( char  fl,
const char *  name,
const char *  pdesc,
CLArgs::IntArgI pcallback 
) [inline]

Definition at line 176 of file CLArgFlag.hpp.

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

Member Function Documentation

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

Get brief format of option

Implements CLArgFlag.

Definition at line 189 of file CLArgFlag.cpp.

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

Implements CLArgFlag.

Definition at line 181 of file CLArgFlag.hpp.

References mCallback.

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

Get UNIX man-page formated synposis of flag

Implements CLArgFlag.

Definition at line 197 of file CLArgFlag.cpp.

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

Implements CLArgFlag.

Definition at line 202 of file CLArgFlag.cpp.

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

Member Data Documentation

Definition at line 172 of file CLArgFlag.hpp.

Referenced by callback().

std::string CLArgInt::mName [private]

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