Public Member Functions | Protected Attributes | Private Member Functions

xmlstorage::XMLBool Class Reference

type converter for boolean data More...

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

List of all members.

Public Member Functions

 this (bool value=false)
 this (in char[] value, bool def=false)
 this (XMLNode node, char[] attr_name, bool def=false)
bool opCast ()
bool opNot ()
char[] str ()

Protected Attributes

bool _value

Private Member Functions

void opAssign (XMLBool)

Detailed Description

type converter for boolean data

Definition at line 1235 of file xmlstorage.d.


Constructor & Destructor Documentation

xmlstorage::XMLBool::this ( bool  value = false ) [inline]

Definition at line 1238 of file xmlstorage.d.

    {
        _value = value;
    }
xmlstorage::XMLBool::this ( in char[]  value,
bool  def = false 
) [inline]

Definition at line 1243 of file xmlstorage.d.

References xmlstorage::XS_TRUE.

    {
        if (value && *value)
            _value = !icmp(value, XS_TRUE);
        else
            _value = def;
    }
xmlstorage::XMLBool::this ( XMLNode  node,
char[]  attr_name,
bool  def = false 
) [inline]

Definition at line 1251 of file xmlstorage.d.

References xmlstorage::XS_TRUE.

    {
        char[] value = node.get(attr_name);

        if (value.length)
            _value = !icmp(value, XS_TRUE);
        else
            _value = def;
    }

Member Function Documentation

void xmlstorage::XMLBool::opAssign ( XMLBool   ) [private]
bool xmlstorage::XMLBool::opCast (  ) [inline]

Definition at line 1261 of file xmlstorage.d.

    {
        return _value;
    }
bool xmlstorage::XMLBool::opNot (  ) [inline]

Definition at line 1266 of file xmlstorage.d.

    {
        return !_value;
    }
char [] xmlstorage::XMLBool::str (  ) [inline]

Definition at line 1271 of file xmlstorage.d.

References xmlstorage::XS_FALSE, and xmlstorage::XS_TRUE.

    {
        return _value? XS_TRUE: XS_FALSE;
    }

Member Data Documentation

bool xmlstorage::XMLBool::_value [protected]

Definition at line 1278 of file xmlstorage.d.


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