ReactOS  0.4.12-dev-43-g63b00d8
XMLStorage::XMLBool Struct Reference

type converter for boolean data More...

#include <xmlstorage.h>

Public Member Functions

 XMLBool (bool value=false)
 
 XMLBool (LPCXSSTR value, bool def=false)
 
 XMLBool (const XMLNode *node, const XS_String &attr_name, bool def=false)
 
 operator bool () const
 
bool operator! () const
 
 operator LPCXSSTR () const
 

Protected Attributes

bool _value
 

Private Member Functions

void operator= (const XMLBool &)
 

Detailed Description

type converter for boolean data

Definition at line 1920 of file xmlstorage.h.

Constructor & Destructor Documentation

◆ XMLBool() [1/3]

XMLStorage::XMLBool::XMLBool ( bool  value = false)
inline

Definition at line 1922 of file xmlstorage.h.

1923  : _value(value)
1924  {
1925  }
Definition: get.c:139

◆ XMLBool() [2/3]

XMLStorage::XMLBool::XMLBool ( LPCXSSTR  value,
bool  def = false 
)
inline

Definition at line 1927 of file xmlstorage.h.

1928  {
1929  if (value && *value)//@@ also handle white space and return def instead of false
1930  _value = !XS_icmp(value, XS_TRUE);
1931  else
1932  _value = def;
1933  }
Definition: get.c:139
#define XS_icmp
Definition: xmlstorage.h:241
#define XS_TRUE
Definition: xmlstorage.h:425

◆ XMLBool() [3/3]

XMLStorage::XMLBool::XMLBool ( const XMLNode node,
const XS_String attr_name,
bool  def = false 
)
inline

Definition at line 1935 of file xmlstorage.h.

1936  {
1937  const XS_String& value = node->get(attr_name);
1938 
1939  if (!value.empty())
1940  _value = !XS_icmp(value.c_str(), XS_TRUE);
1941  else
1942  _value = def;
1943  }
Definition: graphics.c:170
Definition: get.c:139
#define XS_icmp
Definition: xmlstorage.h:241
#define XS_TRUE
Definition: xmlstorage.h:425

Member Function Documentation

◆ operator bool()

Definition at line 1945 of file xmlstorage.h.

1946  {
1947  return _value;
1948  }

◆ operator LPCXSSTR()

Definition at line 1955 of file xmlstorage.h.

1956  {
1957  return _value? XS_TRUE: XS_FALSE;
1958  }
#define XS_FALSE
Definition: xmlstorage.h:426
#define XS_TRUE
Definition: xmlstorage.h:425

◆ operator!()

bool XMLStorage::XMLBool::operator! ( ) const
inline

Definition at line 1950 of file xmlstorage.h.

1951  {
1952  return !_value;
1953  }

◆ operator=()

Member Data Documentation

◆ _value

bool XMLStorage::XMLBool::_value
protected

Definition at line 1961 of file xmlstorage.h.


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