XMLStorage::XMLInt Struct Reference

type converter for integer data More...

#include <xmlstorage.h>

Collaboration diagram for XMLStorage::XMLInt:

Collaboration graph
[legend]

Public Member Functions

 XMLInt (int 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

void operator= (const XMLInt &)

Detailed Description

type converter for integer data

Definition at line 1673 of file xmlstorage.h.


Constructor & Destructor Documentation

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

Definition at line 1675 of file xmlstorage.h.

01676      :  _value(value)
01677     {
01678     }

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

Definition at line 1680 of file xmlstorage.h.

References XS_toi.

01681     {
01682         if (value && *value)
01683             _value = XS_toi(value);
01684         else
01685             _value = def;
01686     }

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

Definition at line 1688 of file xmlstorage.h.

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

01689     {
01690         const XS_String& value = node->get(attr_name);
01691 
01692         if (!value.empty())
01693             _value = XS_toi(value.c_str());
01694         else
01695             _value = def;
01696     }

Here is the call graph for this function:


Member Function Documentation

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

Definition at line 1698 of file xmlstorage.h.

01699     {
01700         return _value;
01701     }

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

Definition at line 1703 of file xmlstorage.h.

References COUNTOF, XS_CHAR, XS_INTFMT, and XS_snprintf.

01704     {
01705         XS_CHAR buffer[32];
01706         XS_snprintf(buffer, COUNTOF(buffer), XS_INTFMT, _value);
01707         return buffer;
01708     }

void XMLStorage::XMLInt::operator= ( const XMLInt  )  [private]


Field Documentation

int XMLStorage::XMLInt::_value [protected]

Definition at line 1711 of file xmlstorage.h.


The documentation for this struct was generated from the following file:
IBrowser Source Code Documentation
generated on 18.09.2008 by doxygen

Homepage