ReactOS  r76032
XMLStorage::XMLInt Struct Reference

type converter for integer data More...

#include <xmlstorage.h>

Collaboration diagram for XMLStorage::XMLInt:

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.

2013  : _value(value)
2014  {
2015  }
Definition: get.c:139
XMLStorage::XMLInt::XMLInt ( LPCXSSTR  value,
int  def = 0 
)
inline

Definition at line 2017 of file xmlstorage.h.

2018  {
2019  if (value && *value)//@@ also handle white space and return def instead of 0
2020  _value = XS_toi(value);
2021  else
2022  _value = def;
2023  }
Definition: get.c:139
#define XS_toi
Definition: xmlstorage.h:244
XMLStorage::XMLInt::XMLInt ( const XMLNode node,
const XS_String attr_name,
int  def = 0 
)
inline

Definition at line 2025 of file xmlstorage.h.

2026  {
2027  const XS_String& value = node->get(attr_name);
2028 
2029  if (!value.empty())
2030  _value = XS_toi(value.c_str());
2031  else
2032  _value = def;
2033  }
Definition: graphics.c:176
Definition: get.c:139
#define XS_toi
Definition: xmlstorage.h:244

Member Function Documentation

Definition at line 2035 of file xmlstorage.h.

2036  {
2037  return _value;
2038  }

Definition at line 2040 of file xmlstorage.h.

2041  {
2042  XS_CHAR buffer[32];
2043  XS_snprintf(buffer, COUNTOF(buffer), XS_INTFMT, _value);
2044  return XS_String(buffer);
2045  }
GLuint buffer
Definition: glext.h:5915
#define XS_snprintf
Definition: xmlstorage.h:247
#define XS_CHAR
Definition: xmlstorage.h:236
#define COUNTOF(b)
Definition: xmlstorage.h:271
#define XS_INTFMT
Definition: xmlstorage.h:427

Member Data Documentation

int XMLStorage::XMLInt::_value
protected

Definition at line 2048 of file xmlstorage.h.

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


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