Public Member Functions | Protected Attributes | Private Member Functions

XMLStorage::XMLInt Struct Reference

type converter for integer data More...

#include <xmlstorage.h>

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

List of all members.

Public Member Functions

 XMLInt (int value)
 XMLInt (size_t value)
 XMLInt (LPCXSSTR value, int def=0)
 XMLInt (const XMLNode *node, const XS_String &attr_name, int def=0)
 operator int () const
 operator XS_String () const

Protected Attributes

int _value

Private Member Functions

XMLIntoperator= (const XMLInt &)

Detailed Description

type converter for integer data

Definition at line 3602 of file xmlstorage.h.


Constructor & Destructor Documentation

XMLStorage::XMLInt::XMLInt ( int  value ) [inline]

Definition at line 3604 of file xmlstorage.h.

     :  _value(value)
    {
    }
XMLStorage::XMLInt::XMLInt ( size_t  value ) [inline]

Definition at line 3609 of file xmlstorage.h.

     :  _value((int)value)
    {
    }
XMLStorage::XMLInt::XMLInt ( LPCXSSTR  value,
int  def = 0 
) [inline]

Definition at line 3614 of file xmlstorage.h.

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

    {
        LPCXSSTR p = safe_skip_space(value);

        if (*p)
            _value = XS_toi(p);
        else
            _value = def;
    }

Here is the call graph for this function:

XMLStorage::XMLInt::XMLInt ( const XMLNode node,
const XS_String attr_name,
int  def = 0 
) [inline]

Definition at line 3624 of file xmlstorage.h.

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

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

        if (!value.empty())
            _value = XS_toi(value.c_str());
        else
            _value = def;
    }

Here is the call graph for this function:


Member Function Documentation

XMLStorage::XMLInt::operator int (  ) const [inline]

Definition at line 3634 of file xmlstorage.h.

References _value.

    {
        return _value;
    }
XMLStorage::XMLInt::operator XS_String (  ) const [inline]

Definition at line 3639 of file xmlstorage.h.

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

    {
        XS_CHAR buffer[32];
        XS_snprintf(buffer, COUNTOF(buffer), XS_INTFMT, _value);
        return XS_String(buffer);
    }
XMLInt& XMLStorage::XMLInt::operator= ( const XMLInt  ) [private]

Member Data Documentation

int XMLStorage::XMLInt::_value [protected]

Definition at line 3647 of file xmlstorage.h.

Referenced by operator int(), operator XS_String(), and XMLInt().


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