Public Member Functions | Protected Attributes

XMLStorage::XMLIntRef Struct Reference

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

#include <xmlstorage.h>

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

List of all members.

Public Member Functions

 XMLIntRef (XMLNode *node, const XS_String &attr_name, int def=0)
XMLIntRefoperator= (int value)
 operator int () const
void assign (int value)

Protected Attributes

XS_String_ref

Detailed Description

type converter for integer data with write access

Definition at line 3654 of file xmlstorage.h.


Constructor & Destructor Documentation

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

Definition at line 3656 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::XMLIntRef::assign ( int  value ) [inline]

Definition at line 3675 of file xmlstorage.h.

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

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

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 3670 of file xmlstorage.h.

References _ref, and XS_toi.

    {
        return XS_toi(_ref.c_str());
    }
XMLIntRef& XMLStorage::XMLIntRef::operator= ( int  value ) [inline]

Definition at line 3663 of file xmlstorage.h.

References assign().

    {
        assign(value);

        return *this;
    }

Here is the call graph for this function:


Member Data Documentation

Definition at line 3683 of file xmlstorage.h.

Referenced by assign(), operator int(), and XMLIntRef().


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