Public Member Functions | Protected Attributes

XMLStorage::XMLBool Struct Reference

type converter for boolean data More...

#include <xmlstorage.h>

Collaboration diagram for XMLStorage::XMLBool:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 XMLBool (bool value=false)
 XMLBool (LPCXSSTR value, bool def=false)
 XMLBool (const XMLNode *node, const XS_String &attr_name, bool def=false)
 operator bool () const
bool operator! () const
 operator LPCXSSTR () const

Protected Attributes

bool _value

Detailed Description

type converter for boolean data

Definition at line 3415 of file xmlstorage.h.


Constructor & Destructor Documentation

XMLStorage::XMLBool::XMLBool ( bool  value = false ) [inline]

Definition at line 3417 of file xmlstorage.h.

     :  _value(value)
    {
    }
XMLStorage::XMLBool::XMLBool ( LPCXSSTR  value,
bool  def = false 
) [inline]

Definition at line 3422 of file xmlstorage.h.

References _value, LPCXSSTR, XMLStorage::safe_skip_space(), XS_nicmp, and XS_TRUE.

    {
        LPCXSSTR p = safe_skip_space(value);

        if (*p)
            _value = !XS_nicmp(p, XS_TRUE, 4); //_tcslen(XS_TRUE_STR)=4
        else
            _value = def;
    }

Here is the call graph for this function:

XMLStorage::XMLBool::XMLBool ( const XMLNode node,
const XS_String attr_name,
bool  def = false 
) [inline]

Definition at line 3432 of file xmlstorage.h.

References _value, XMLStorage::XMLNode::get(), XS_icmp, and XS_TRUE.

    {
        const XS_String& value = node->get(attr_name);

        if (!value.empty())
            _value = !XS_icmp(value.c_str(), XS_TRUE);
        else
            _value = def;
    }

Here is the call graph for this function:


Member Function Documentation

XMLStorage::XMLBool::operator bool (  ) const [inline]

Definition at line 3442 of file xmlstorage.h.

References _value.

    {
        return _value;
    }
XMLStorage::XMLBool::operator LPCXSSTR (  ) const [inline]

Definition at line 3452 of file xmlstorage.h.

References _value, XS_FALSE, and XS_TRUE.

    {
        return _value? XS_TRUE: XS_FALSE;
    }
bool XMLStorage::XMLBool::operator! (  ) const [inline]

Definition at line 3447 of file xmlstorage.h.

References _value.

    {
        return !_value;
    }

Member Data Documentation

bool XMLStorage::XMLBool::_value [protected]

Definition at line 3458 of file xmlstorage.h.

Referenced by operator bool(), operator LPCXSSTR(), operator!(), and XMLBool().


The documentation for this struct was generated from the following file:

ROS Explorer Source Code Documentation
generated on 02.01.2013 by doxygen

ROS Explorer Homepage