Public Member Functions | Protected Attributes

XMLStorage::XMLDoubleRef Struct Reference

type converter for numeric data with write access More...

#include <xmlstorage.h>

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

List of all members.

Public Member Functions

 XMLDoubleRef (XMLNode *node, const XS_String &attr_name, double def=0.)
XMLDoubleRefoperator= (double value)
 operator double () const
void assign (double value)

Protected Attributes

XS_String_ref

Detailed Description

type converter for numeric data with write access

Definition at line 3823 of file xmlstorage.h.


Constructor & Destructor Documentation

XMLStorage::XMLDoubleRef::XMLDoubleRef ( XMLNode node,
const XS_String attr_name,
double  def = 0. 
) [inline]

Definition at line 3825 of file xmlstorage.h.

References _ref, and assign().

     :  _ref((*node)[attr_name])
    {
        if (_ref.empty())
            assign(def);
    }

Here is the call graph for this function:


Member Function Documentation

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

Definition at line 3845 of file xmlstorage.h.

References _ref, XMLStorage::XS_String::assign(), COUNTOF, XS_CHAR, XS_FLOATFMT, and XS_snprintf.

Referenced by operator=(), and XMLDoubleRef().

    {
        XS_CHAR buffer[32];
        XS_snprintf(buffer, COUNTOF(buffer), XS_FLOATFMT, value);
        _ref.assign(buffer);
    }

Here is the call graph for this function:

Here is the caller graph for this function:

XMLStorage::XMLDoubleRef::operator double (  ) const [inline]

Definition at line 3839 of file xmlstorage.h.

References _ref, and XS_tod.

    {
        LPTSTR end;
        return XS_tod(_ref.c_str(), &end);
    }
XMLDoubleRef& XMLStorage::XMLDoubleRef::operator= ( double  value ) [inline]

Definition at line 3832 of file xmlstorage.h.

References assign().

    {
        assign(value);

        return *this;
    }

Here is the call graph for this function:


Member Data Documentation

Definition at line 3853 of file xmlstorage.h.

Referenced by assign(), operator double(), and XMLDoubleRef().


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