Public Member Functions | Protected Attributes | Private Member Functions

XMLStorage::XMLBoolRef Class Reference

XMLBoolRef is a type converter for bool data with write access. More...

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

List of all members.

Public Member Functions

 XMLBoolRef (XMLNode node, string attrName)
 XMLBoolRef (XMLNode node, string attrName, bool def)
bool boolValue ()
void assign (bool value)
 Set bool value in referenced node.

Protected Attributes

XMLNode _node
string _attrName

Private Member Functions

void init (XMLNode node, string attrName, bool def)

Detailed Description

XMLBoolRef is a type converter for bool data with write access.

Definition at line 125 of file XMLBool.cs.


Constructor & Destructor Documentation

XMLStorage::XMLBoolRef::XMLBoolRef ( XMLNode  node,
string  attrName 
) [inline]

Definition at line 127 of file XMLBool.cs.

References init().

    {
        init(node, attrName, false);
    }

Here is the call graph for this function:

XMLStorage::XMLBoolRef::XMLBoolRef ( XMLNode  node,
string  attrName,
bool  def 
) [inline]

Definition at line 132 of file XMLBool.cs.

References init().

    {
        init(node, attrName, def);
    }

Here is the call graph for this function:


Member Function Documentation

void XMLStorage::XMLBoolRef::assign ( bool  value ) [inline]

Set bool value in referenced node.

Parameters:
value

Definition at line 164 of file XMLBool.cs.

References _attrName, _node, and XMLStorage::XMLNode::put().

Referenced by init().

    {
        if (_node != null)
            _node.put(_attrName, value.ToString());
    }

Here is the call graph for this function:

bool XMLStorage::XMLBoolRef::boolValue (  ) [inline]
Returns:
bool value of referenced node

Definition at line 150 of file XMLBool.cs.

References _attrName, _node, and XMLStorage::XMLNode::get().

    {
        bool value;

        if (_node != null && bool.TryParse(_node.get(_attrName), out value))
            return value;
        else
            return false;
    }

Here is the call graph for this function:

void XMLStorage::XMLBoolRef::init ( XMLNode  node,
string  attrName,
bool  def 
) [inline, private]

Definition at line 137 of file XMLBool.cs.

References _attrName, _node, assign(), and XMLStorage::XMLNode::get().

Referenced by XMLBoolRef().

    {
        _node = node;
        _attrName = attrName;

        if (node != null)
            if (node.get(attrName).Length == 0)
                assign(def);
    }

Here is the call graph for this function:


Member Data Documentation

Definition at line 171 of file XMLBool.cs.

Referenced by assign(), boolValue(), and init().

Definition at line 170 of file XMLBool.cs.

Referenced by assign(), boolValue(), and init().


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