ReactOS 0.4.15-dev-8021-g7ce96fd
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: pdh_main.c:94

◆ 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
1931 else
1932 _value = def;
1933 }
#define XS_TRUE
Definition: xmlstorage.h:425
#define XS_icmp
Definition: xmlstorage.h:241

◆ 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: dlist.c:348

Member Function Documentation

◆ operator bool()

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

Definition at line 1945 of file xmlstorage.h.

1946 {
1947 return _value;
1948 }

◆ operator LPCXSSTR()

XMLStorage::XMLBool::operator LPCXSSTR ( ) const
inline

Definition at line 1955 of file xmlstorage.h.

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

◆ operator!()

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

Definition at line 1950 of file xmlstorage.h.

1951 {
1952 return !_value;
1953 }

◆ operator=()

void XMLStorage::XMLBool::operator= ( const XMLBool )
private

Member Data Documentation

◆ _value

bool XMLStorage::XMLBool::_value
protected

Definition at line 1961 of file xmlstorage.h.

Referenced by operator bool(), operator LPCXSSTR(), operator!(), and XMLBool().


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