Public Member Functions | Private Member Functions | Private Attributes

val_Bool Class Reference
[Parser for config files; validation]

#include <val.h>

Inheritance diagram for val_Bool:
Inheritance graph
[legend]
Collaboration diagram for val_Bool:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 val_Bool (const string &a_name, const val_Limit a_limits, const UInt32_t a_minNumOfVal=1, const UInt64_t a_maxNumOfVal=cfg_INFINITE)
virtual ~val_Bool ()
virtual void Bind (bool &a_dest)

Private Member Functions

virtual void Assign (const string &a_strVal)

Private Attributes

bool * m_bool_p
 log_CLASSID_m

Detailed Description

Definition at line 501 of file val.h.


Constructor & Destructor Documentation

val_Bool::val_Bool ( const string &  a_name,
const val_Limit  a_limits,
const UInt32_t  a_minNumOfVal = 1,
const UInt64_t  a_maxNumOfVal = cfg_INFINITE 
)

Definition at line 297 of file val.cpp.

  : val_Value(a_name, a_limits, a_minNumOfVal, a_maxNumOfVal),
    m_bool_p(NULL) {
    // Empty
}

val_Bool::~val_Bool (  )  [virtual]

Definition at line 307 of file val.cpp.

                    {
    //Empty
}


Member Function Documentation

void val_Bool::Assign ( const string &  a_strVal  )  [private, virtual]

Definition at line 316 of file val.cpp.

References ie_PARSER_ERROR, ivd_Error, m_bool_p, val_Value::m_name, and NULL.

                                            {
    if (m_bool_p == NULL) {
        return;
    };

    if (a_strVal == "true" || a_strVal == "yes" || a_strVal == "1") {
        *m_bool_p = true;
    }
    else if (a_strVal == "false" || a_strVal == "no" || a_strVal == "0"){
        *m_bool_p = false;
    }
    else {
        ostringstream sstr;
        sstr
            << m_name << ": "
            << "Expected true, false, yes, no, 1 or 0.";

        throw ivd_Error(ie_PARSER_ERROR, sstr.str());
    }
}

void val_Bool::Bind ( bool &  a_dest  )  [virtual]

Definition at line 311 of file val.cpp.

References m_bool_p.

                                {
    m_bool_p = &(a_dest);
}


Member Data Documentation

Reimplemented from val_Value.

Definition at line 519 of file val.h.

bool* val_Bool::m_bool_p [private]

Definition at line 517 of file val.h.

Referenced by Assign(), and Bind().


The documentation for this class was generated from the following files: