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 (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 2010 of file xmlstorage.h.


Constructor & Destructor Documentation

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

Definition at line 2012 of file xmlstorage.h.

02012 {
02013     XMLInt(int value)
02014      :  _value(value)
02015     {

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

Definition at line 2017 of file xmlstorage.h.

References XS_toi.

02019     {
02020         if (value && *value)//@@ also handle white space and return def instead of 0
02021             _value = XS_toi(value);
02022         else
02023             _value = def;

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

Definition at line 2025 of file xmlstorage.h.

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

02027     {
02028         const XS_String& value = node->get(attr_name);
02029 
02030         if (!value.empty())
02031             _value = XS_toi(value.c_str());
02032         else
02033             _value = def;

Here is the call graph for this function:


Member Function Documentation

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

Definition at line 2035 of file xmlstorage.h.

02037     {
02038         return _value;

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

Definition at line 2040 of file xmlstorage.h.

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

02042     {
02043         XS_CHAR buffer[32];
02044         XS_snprintf(buffer, COUNTOF(buffer), XS_INTFMT, _value);
02045         return XS_String(buffer);

Here is the call graph for this function:

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


Member Data Documentation

int XMLStorage::XMLInt::_value [protected]

Definition at line 2048 of file xmlstorage.h.


The documentation for this struct was generated from the following file:
Generated on Sat Jan 9 00:05:56 2010 for XMLStorage/C++ by  doxygen 1.5.4