XMLStorage::XMLBool Struct Reference

type converter for boolean data More...

#include <xmlstorage.h>

Collaboration diagram for XMLStorage::XMLBool:

Collaboration graph
[legend]

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

void operator= (const XMLBool &)

Detailed Description

type converter for boolean data

Definition at line 1583 of file xmlstorage.h.


Constructor & Destructor Documentation

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

Definition at line 1585 of file xmlstorage.h.

01586      :  _value(value)
01587     {
01588     }

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

Definition at line 1590 of file xmlstorage.h.

References XS_icmp, and XS_TRUE.

01591     {
01592         if (value && *value)
01593             _value = !XS_icmp(value, XS_TRUE);
01594         else
01595             _value = def;
01596     }

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

Definition at line 1598 of file xmlstorage.h.

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

01599     {
01600         const XS_String& value = node->get(attr_name);
01601 
01602         if (!value.empty())
01603             _value = !XS_icmp(value.c_str(), XS_TRUE);
01604         else
01605             _value = def;
01606     }

Here is the call graph for this function:


Member Function Documentation

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

Definition at line 1608 of file xmlstorage.h.

01609     {
01610         return _value;
01611     }

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

Definition at line 1613 of file xmlstorage.h.

01614     {
01615         return !_value;
01616     }

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

Definition at line 1618 of file xmlstorage.h.

References XS_FALSE, and XS_TRUE.

01619     {
01620         return _value? XS_TRUE: XS_FALSE;
01621     }

void XMLStorage::XMLBool::operator= ( const XMLBool  )  [private]


Field Documentation

bool XMLStorage::XMLBool::_value [protected]

Definition at line 1624 of file xmlstorage.h.


The documentation for this struct was generated from the following file:
IBrowser Source Code Documentation
generated on 18.09.2008 by doxygen

Homepage