Public Member Functions | Protected Attributes | Private Member Functions

XMLStorage::XMLDouble Struct Reference

type converter for numeric data More...

#include <xmlstorage.h>

Collaboration diagram for XMLStorage::XMLDouble:
Collaboration graph

List of all members.

Public Member Functions

 XMLDouble (double value)
 XMLDouble (LPCXSSTR value, double def=0.)
 XMLDouble (const XMLNode *node, const XS_String &attr_name, double def=0.)
 operator double () const
 operator XS_String () const

Protected Attributes

double _value

Private Member Functions

XMLDoubleoperator= (const XMLDouble &)

Detailed Description

type converter for numeric data

Definition at line 3774 of file xmlstorage.h.

Constructor & Destructor Documentation

XMLStorage::XMLDouble::XMLDouble ( double  value ) [inline]

Definition at line 3776 of file xmlstorage.h.

     :  _value(value)
XMLStorage::XMLDouble::XMLDouble ( LPCXSSTR  value,
double  def = 0. 
) [inline]

Definition at line 3781 of file xmlstorage.h.

References _value, LPCXSSTR, XMLStorage::safe_skip_space(), and XS_tod.

        LPCXSSTR p = safe_skip_space(value);
        LPTSTR end;

        if (*p)
            _value = XS_tod(p, &end);
            _value = def;

Here is the call graph for this function:

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

Definition at line 3792 of file xmlstorage.h.

References _value, XMLStorage::XMLNode::get(), and XS_tod.

        LPTSTR end;
        const XS_String& value = node->get(attr_name);

        if (!value.empty())
            _value = XS_tod(value.c_str(), &end);
            _value = def;

Here is the call graph for this function:

Member Function Documentation

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

Definition at line 3803 of file xmlstorage.h.

References _value.

        return _value;
XMLStorage::XMLDouble::operator XS_String (  ) const [inline]

Definition at line 3808 of file xmlstorage.h.

References _value, COUNTOF, XS_CHAR, XS_FLOATFMT, and XS_snprintf.

        XS_CHAR buffer[32];
        XS_snprintf(buffer, COUNTOF(buffer), XS_FLOATFMT, _value);
        return XS_String(buffer);
XMLDouble& XMLStorage::XMLDouble::operator= ( const XMLDouble  ) [private]

Member Data Documentation

double XMLStorage::XMLDouble::_value [protected]

Definition at line 3816 of file xmlstorage.h.

Referenced by operator double(), operator XS_String(), and XMLDouble().

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