Public Member Functions | Protected Attributes | Private Member Functions

XMLStorage::XMLDoubleRef Class Reference

XMLDoubleRef is a type converter for numeric data with write access. More...

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

List of all members.

Public Member Functions

 XMLDoubleRef (XMLNode node, string attrName)
 XMLDoubleRef (XMLPos pos, string attrName)
 XMLDoubleRef (XMLNode node, string attrName, double def)
 XMLDoubleRef (XMLPos pos, string attrName, double def)
double doubleValue ()
void assign (double value)

Protected Attributes

XMLNode _node
string _attrName

Private Member Functions

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

Detailed Description

XMLDoubleRef is a type converter for numeric data with write access.

Definition at line 122 of file XMLDouble.cs.


Constructor & Destructor Documentation

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

Definition at line 124 of file XMLDouble.cs.

References init().

    {
        init(node, attrName, 0);
    }

Here is the call graph for this function:

XMLStorage::XMLDoubleRef::XMLDoubleRef ( XMLPos  pos,
string  attrName 
) [inline]

Definition at line 129 of file XMLDouble.cs.

References XMLStorage::XMLPos::cur(), and init().

    {
        init(pos.cur(), attrName, 0);
    }

Here is the call graph for this function:

XMLStorage::XMLDoubleRef::XMLDoubleRef ( XMLNode  node,
string  attrName,
double  def 
) [inline]

Definition at line 134 of file XMLDouble.cs.

References init().

    {
        init(node, attrName, def);
    }

Here is the call graph for this function:

XMLStorage::XMLDoubleRef::XMLDoubleRef ( XMLPos  pos,
string  attrName,
double  def 
) [inline]

Definition at line 139 of file XMLDouble.cs.

References XMLStorage::XMLPos::cur(), and init().

    {
        init(pos.cur(), attrName, def);
    }

Here is the call graph for this function:


Member Function Documentation

void XMLStorage::XMLDoubleRef::assign ( double  value ) [inline]

Definition at line 164 of file XMLDouble.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:

double XMLStorage::XMLDoubleRef::doubleValue (  ) [inline]

Definition at line 154 of file XMLDouble.cs.

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

    {
        double value;

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

Here is the call graph for this function:

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

Definition at line 144 of file XMLDouble.cs.

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

Referenced by XMLDoubleRef().

    {
        _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 XMLDouble.cs.

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

Definition at line 170 of file XMLDouble.cs.

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


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