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

Private Member Functions

void operator= (const XMLBool &)


Detailed Description

type converter for boolean data

Definition at line 1920 of file xmlstorage.h.


Constructor & Destructor Documentation

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

Definition at line 1922 of file xmlstorage.h.

01922 {
01923     XMLBool(bool value=false)
01924      :  _value(value)
01925     {

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

Definition at line 1927 of file xmlstorage.h.

References XS_icmp, and XS_TRUE.

01929     {
01930         if (value && *value)//@@ also handle white space and return def instead of false
01931             _value = !XS_icmp(value, XS_TRUE);
01932         else
01933             _value = def;

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

Definition at line 1935 of file xmlstorage.h.

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

01937     {
01938         const XS_String& value = node->get(attr_name);
01939 
01940         if (!value.empty())
01941             _value = !XS_icmp(value.c_str(), XS_TRUE);
01942         else
01943             _value = def;

Here is the call graph for this function:


Member Function Documentation

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

Definition at line 1945 of file xmlstorage.h.

01947     {
01948         return _value;

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

Definition at line 1950 of file xmlstorage.h.

01952     {
01953         return !_value;

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

Definition at line 1955 of file xmlstorage.h.

References XS_FALSE, and XS_TRUE.

01957     {
01958         return _value? XS_TRUE: XS_FALSE;

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


Member Data Documentation

bool XMLStorage::XMLBool::_value [protected]

Definition at line 1961 of file xmlstorage.h.


The documentation for this struct was generated from the following file:
Generated on Sat Jan 9 00:05:56 2010 for XMLStorage/C++ by  doxygen 1.5.4