ReactOS  0.4.12-dev-102-g4b7f1e0
XMLStorage::XMLDouble Struct Reference

type converter for numeric data More...

#include <xmlstorage.h>

Public Member Functions

 XMLDouble (double value)
 
 XMLDouble (LPCXSSTR value, double def=0.)
 
 XMLDouble (const XMLNode *node, const XS_String &attr_name, double def=0.)
 
 operator double () const
 
 operator XS_String () const
 

Protected Attributes

double _value
 

Private Member Functions

void operator= (const XMLDouble &)
 

Detailed Description

type converter for numeric data

Definition at line 2089 of file xmlstorage.h.

Constructor & Destructor Documentation

◆ XMLDouble() [1/3]

XMLStorage::XMLDouble::XMLDouble ( double  value)
inline

Definition at line 2091 of file xmlstorage.h.

2092  : _value(value)
2093  {
2094  }
Definition: get.c:139

◆ XMLDouble() [2/3]

XMLStorage::XMLDouble::XMLDouble ( LPCXSSTR  value,
double  def = 0. 
)
inline

Definition at line 2096 of file xmlstorage.h.

2097  {
2098  LPTSTR end;
2099 
2100  if (value && *value)//@@ also handle white space and return def instead of 0
2101  _value = XS_tod(value, &end);
2102  else
2103  _value = def;
2104  }
Definition: get.c:139
GLuint GLuint end
Definition: gl.h:1545
#define XS_tod
Definition: xmlstorage.h:245
CHAR * LPTSTR
Definition: xmlstorage.h:192

◆ XMLDouble() [3/3]

XMLStorage::XMLDouble::XMLDouble ( const XMLNode node,
const XS_String attr_name,
double  def = 0. 
)
inline

Definition at line 2106 of file xmlstorage.h.

2107  {
2108  LPTSTR end;
2109  const XS_String& value = node->get(attr_name);
2110 
2111  if (!value.empty())
2112  _value = XS_tod(value.c_str(), &end);
2113  else
2114  _value = def;
2115  }
Definition: graphics.c:170
Definition: get.c:139
GLuint GLuint end
Definition: gl.h:1545
#define XS_tod
Definition: xmlstorage.h:245
CHAR * LPTSTR
Definition: xmlstorage.h:192

Member Function Documentation

◆ operator double()

Definition at line 2117 of file xmlstorage.h.

2118  {
2119  return _value;
2120  }

◆ operator XS_String()

Definition at line 2122 of file xmlstorage.h.

2123  {
2124  XS_CHAR buffer[32];
2125  XS_snprintf(buffer, COUNTOF(buffer), XS_FLOATFMT, _value);
2126  return XS_String(buffer);
2127  }
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_FLOATFMT
Definition: xmlstorage.h:428

◆ operator=()

Member Data Documentation

◆ _value

double XMLStorage::XMLDouble::_value
protected

Definition at line 2130 of file xmlstorage.h.


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