ReactOS 0.4.15-dev-7953-g1f49173
XMLStorage::XMLBoolRef Struct Reference

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

#include <xmlstorage.h>

Collaboration diagram for XMLStorage::XMLBoolRef:

Public Member Functions

 XMLBoolRef (XMLNode *node, const XS_String &attr_name, bool def=false)
 
 operator bool () const
 
bool operator! () const
 
XMLBoolRefoperator= (bool value)
 
void assign (bool value)
 
void toggle ()
 

Protected Attributes

XS_String_ref
 

Detailed Description

type converter for boolean data with write access

Definition at line 1968 of file xmlstorage.h.

Constructor & Destructor Documentation

◆ XMLBoolRef()

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

Definition at line 1970 of file xmlstorage.h.

1971 : _ref((*node)[attr_name])
1972 {
1973 if (_ref.empty())
1974 assign(def);
1975 }
void assign(bool value)
Definition: xmlstorage.h:1994
Definition: dlist.c:348

Member Function Documentation

◆ assign()

void XMLStorage::XMLBoolRef::assign ( bool  value)
inline

Definition at line 1994 of file xmlstorage.h.

1995 {
1997 }
void assign(const XS_String &s)
Definition: xmlstorage.h:338
Definition: pdh_main.c:94
#define XS_TRUE
Definition: xmlstorage.h:425
#define XS_FALSE
Definition: xmlstorage.h:426

Referenced by operator=(), toggle(), and XMLBoolRef().

◆ operator bool()

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

Definition at line 1977 of file xmlstorage.h.

1978 {
1979 return !XS_icmp(_ref.c_str(), XS_TRUE);
1980 }
#define XS_icmp
Definition: xmlstorage.h:241

◆ operator!()

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

Definition at line 1982 of file xmlstorage.h.

1983 {
1984 return XS_icmp(_ref.c_str(), XS_TRUE)? true: false;
1985 }

◆ operator=()

XMLBoolRef & XMLStorage::XMLBoolRef::operator= ( bool  value)
inline

Definition at line 1987 of file xmlstorage.h.

1988 {
1989 assign(value);
1990
1991 return *this;
1992 }

◆ toggle()

void XMLStorage::XMLBoolRef::toggle ( )
inline

Definition at line 1999 of file xmlstorage.h.

2000 {
2001 assign(!operator bool());
2002 }

Member Data Documentation

◆ _ref

XS_String& XMLStorage::XMLBoolRef::_ref
protected

Definition at line 2005 of file xmlstorage.h.

Referenced by assign(), operator bool(), operator!(), and XMLBoolRef().


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