MOAB: Mesh Oriented datABase  (version 5.2.1)
CLArgFlag Class Reference

#include <CLArgFlag.hpp>

+ Inheritance diagram for CLArgFlag:
+ Collaboration diagram for CLArgFlag:

Public Member Functions

virtual ~CLArgFlag ()
char flag () const
const char * desc () const
virtual const CLArgs::ArgIBasecallback () const =0
virtual bool is_toggle () const
virtual bool parse (const char *string_value) const =0
virtual std::string brief () const =0
virtual std::string manstr () const =0
virtual bool add_set (int size, const char *const *names)
std::string make_man_string (int count, const char *names[]) const
std::string make_man_string (const char *arg_name) const
std::string make_man_string () const
std::string make_literal_man_string (int count, const char *literal_args[]) const
std::string make_literal_man_string (const char *literal_args) const

Protected Member Functions

 CLArgFlag (char pflag, const char *pdesc)

Private Attributes

char mFlag
std::string mDesc

Detailed Description

Definition at line 41 of file CLArgFlag.hpp.


Constructor & Destructor Documentation

CLArgFlag::CLArgFlag ( char  pflag,
const char *  pdesc 
) [inline, protected]

Definition at line 48 of file CLArgFlag.hpp.

: mFlag( pflag ), mDesc( pdesc ) {}
CLArgFlag::~CLArgFlag ( ) [virtual]

Definition at line 50 of file CLArgFlag.cpp.

{}

Member Function Documentation

bool CLArgFlag::add_set ( int  size,
const char *const *  names 
) [virtual]

Reimplemented in CLArgDoubleList, and CLArgIntList.

Definition at line 88 of file CLArgFlag.cpp.

Referenced by CLArgs::limit_list_flag().

{
    return false;
}
virtual std::string CLArgFlag::brief ( ) const [pure virtual]

Get brief format of option

Implemented in CLArgDoubleList, CLArgIntList, CLArgIDList, CLArgDouble, CLArgInt, CLArgLong, CLArgString, and CLArgToggle.

const char* CLArgFlag::desc ( ) const [inline]

Definition at line 57 of file CLArgFlag.hpp.

References mDesc.

    {
        return mDesc.c_str();
    }
bool CLArgFlag::is_toggle ( ) const [virtual]

Reimplemented in CLArgToggle.

Definition at line 83 of file CLArgFlag.cpp.

Referenced by CLArgs::parse_options().

{
    return false;
}
std::string CLArgFlag::make_literal_man_string ( int  count,
const char *  literal_args[] 
) const

Definition at line 69 of file CLArgFlag.cpp.

References ManPage::begin_bold(), ManPage::bold(), ManPage::end_bold(), and flag().

Referenced by make_literal_man_string().

{
    std::ostringstream ss;
    ManPage::begin_bold( ss ) << "-" << flag();
    ManPage::end_bold( ss );
    if( count )
    {
        ss << args[0];
        for( int i = 1; i < count; ++i )
            ManPage::bold( ss, args[i] );
    }
    return ss.str();
}
std::string CLArgFlag::make_literal_man_string ( const char *  literal_args) const [inline]

Definition at line 83 of file CLArgFlag.hpp.

References make_literal_man_string().

    {
        return make_literal_man_string( 1, &literal_args );
    }
std::string CLArgFlag::make_man_string ( int  count,
const char *  names[] 
) const

Definition at line 52 of file CLArgFlag.cpp.

References ManPage::begin_bold(), ManPage::end_bold(), and flag().

{
    std::ostringstream ss;
    ManPage::begin_bold( ss ) << "-" << flag();
    ManPage::end_bold( ss );
    if( count )
    {
        ss << "<" << names[0];
        for( int i = 1; i < count; ++i )
        {
            ss << "|";
        }
        ss << ">";
    }
    return ss.str();
}
std::string CLArgFlag::make_man_string ( const char *  arg_name) const [inline]

Definition at line 74 of file CLArgFlag.hpp.

References make_man_string().

    {
        return make_man_string( 1, &arg_name );
    }
std::string CLArgFlag::make_man_string ( ) const [inline]

Definition at line 78 of file CLArgFlag.hpp.

Referenced by make_man_string(), and CLArgToggle::manstr().

    {
        return make_man_string( 0, 0 );
    }
virtual std::string CLArgFlag::manstr ( ) const [pure virtual]

Get UNIX man-page formated synposis of flag

Implemented in CLArgDoubleList, CLArgIntList, CLArgIDList, CLArgDouble, CLArgInt, CLArgLong, CLArgString, and CLArgToggle.

virtual bool CLArgFlag::parse ( const char *  string_value) const [pure virtual]

Member Data Documentation

std::string CLArgFlag::mDesc [private]

Definition at line 45 of file CLArgFlag.hpp.

Referenced by desc().

char CLArgFlag::mFlag [private]

Definition at line 44 of file CLArgFlag.hpp.

Referenced by flag().

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