Public Member Functions | Private Member Functions | Private Attributes

val_StrictString Class Reference
[Parser for config files; validation]

StrictString does check leading and trailing spaces plus new lines inside string. More...

#include <val.h>

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

List of all members.

Public Member Functions

 val_StrictString (const string &a_name, const val_Limit a_limits, const UInt32_t a_minNumOfVal=1, const UInt32_t a_maxNumOfVal=cfg_MAX_PATHNAME)
 val_StrictString (const string &a_name, const val_Limit a_limits, const UInt32_t a_minNumOfVal, const UInt32_t a_maxNumOfVal, const string &a_defaultPath)

Private Member Functions

virtual void CheckSpaces (const string &a_strVal)
virtual void Assign (const string &a_strVal)

Private Attributes

 log_CLASSID_m

Detailed Description

StrictString does check leading and trailing spaces plus new lines inside string.

Definition at line 447 of file val.h.


Constructor & Destructor Documentation

val_StrictString::val_StrictString ( const string &  a_name,
const val_Limit  a_limits,
const UInt32_t  a_minNumOfVal = 1,
const UInt32_t  a_maxNumOfVal = cfg_MAX_PATHNAME 
) [inline]

Definition at line 449 of file val.h.

    : val_String(a_name, a_limits, a_minNumOfVal, a_maxNumOfVal) {
        // Empty
    };

val_StrictString::val_StrictString ( const string &  a_name,
const val_Limit  a_limits,
const UInt32_t  a_minNumOfVal,
const UInt32_t  a_maxNumOfVal,
const string &  a_defaultPath 
) [inline]

Definition at line 458 of file val.h.

    : val_String(a_name, a_limits, a_minNumOfVal, a_maxNumOfVal, a_defaultPath) {
        // Empty
    };


Member Function Documentation

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

Reimplemented from val_String.

Definition at line 284 of file val.cpp.

References CheckSpaces(), val_String::m_str_p, and NULL.

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

    CheckSpaces(a_strVal);
    *m_str_p = a_strVal;
}

Here is the call graph for this function:

void val_StrictString::CheckSpaces ( const string &  a_strVal  )  [private, virtual]

Definition at line 261 of file val.cpp.

References ie_INVALID_STRING, ivd_Error, and val_Value::m_name.

Referenced by Assign().

                                                         {
    if (a_strVal.length() == 0) {
        return;
    };

    if (isspace(a_strVal[0])  ){
        throw ivd_Error(ie_INVALID_STRING,
            string("space at begining of string:") + a_strVal +
            string(" at variable:") + m_name);
    }
    if (isspace(a_strVal[a_strVal.size()-1])) {
        throw ivd_Error(ie_INVALID_STRING,
            string("space at end of string:") + a_strVal +
            string(" at variable:") + m_name );
    }
    for (UInt32_t i = 0; i < a_strVal.size(); i++) {
        if (a_strVal[i] == '\n' )
            throw ivd_Error(ie_INVALID_STRING,
            string("NewLine inside of string:") + a_strVal +
            string(" at variable:") + m_name);
    }
}

Here is the caller graph for this function:


Member Data Documentation

Reimplemented from val_String.

Reimplemented in val_ObjectName, val_Hostname, val_DbgLevel, and val_DbgFlags.

Definition at line 471 of file val.h.


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