ReactOS  0.4.12-dev-36-g472787f
XMLStorage::XMLIntRef Struct Reference

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

#include <xmlstorage.h>

Collaboration diagram for XMLStorage::XMLIntRef:

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

Constructor & Destructor Documentation

◆ XMLIntRef()

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

Definition at line 2057 of file xmlstorage.h.

2058  : _ref((*node)[attr_name])
2059  {
2060  if (_ref.empty())
2061  assign(def);
2062  }
Definition: graphics.c:170
void assign(int value)
Definition: xmlstorage.h:2076

Member Function Documentation

◆ assign()

void XMLStorage::XMLIntRef::assign ( int  value)
inline

Definition at line 2076 of file xmlstorage.h.

2077  {
2078  XS_CHAR buffer[32];
2079  XS_snprintf(buffer, COUNTOF(buffer), XS_INTFMT, value);
2080  _ref.assign(buffer);
2081  }
Definition: get.c:139
GLuint buffer
Definition: glext.h:5915
void assign(const XS_String &s)
Definition: xmlstorage.h:338
#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

◆ operator int()

Definition at line 2071 of file xmlstorage.h.

2072  {
2073  return XS_toi(_ref.c_str());
2074  }
#define XS_toi
Definition: xmlstorage.h:244

◆ operator=()

Definition at line 2064 of file xmlstorage.h.

2065  {
2066  assign(value);
2067 
2068  return *this;
2069  }
Definition: get.c:139
void assign(int value)
Definition: xmlstorage.h:2076

Member Data Documentation

◆ _ref

XS_String& XMLStorage::XMLIntRef::_ref
protected

Definition at line 2084 of file xmlstorage.h.


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