type converter for boolean data More...
#include <xmlstorage.h>

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 |
Private Member Functions | |
| XMLBool & | operator= (const XMLBool &) |
type converter for boolean data
Definition at line 3510 of file xmlstorage.h.
| XMLStorage::XMLBool::XMLBool | ( | bool | value = false ) |
[inline] |
Definition at line 3512 of file xmlstorage.h.
: _value(value) { }
| XMLStorage::XMLBool::XMLBool | ( | LPCXSSTR | value, |
| bool | def = false |
||
| ) | [inline] |
Definition at line 3517 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;
}

| XMLStorage::XMLBool::XMLBool | ( | const XMLNode * | node, |
| const XS_String & | attr_name, | ||
| bool | def = false |
||
| ) | [inline] |
Definition at line 3527 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;
}

| XMLStorage::XMLBool::operator bool | ( | ) | const [inline] |
| XMLStorage::XMLBool::operator LPCXSSTR | ( | ) | const [inline] |
| bool XMLStorage::XMLBool::operator! | ( | ) | const [inline] |
bool XMLStorage::XMLBool::_value [protected] |
Definition at line 3553 of file xmlstorage.h.
Referenced by operator bool(), operator LPCXSSTR(), operator!(), and XMLBool().
1.7.2