XMLBool is a type converter for boolean data. More...
Public Member Functions | |
XMLBool (bool value) | |
XMLBool (string value) | |
XMLBool (string value, bool def) | |
XMLBool (AbstractXMLNode node, string attrName) | |
XMLBool (XMLPos pos, string attrName) | |
XMLBool (XMLPos pos, string attrName, bool def) | |
XMLBool (XMLStreamReader reader, string attrName) | |
XMLBool (XMLStreamReader reader, string attrName, bool def) | |
XMLBool (AbstractXMLNode node, string attrName, bool def) | |
bool | boolValue () |
override string | ToString () |
Protected Attributes | |
bool | _value |
Private Member Functions | |
void | init (string value, bool def) |
void | init (AbstractXMLNode node, string attrName, bool def) |
XMLBool is a type converter for boolean data.
Definition at line 45 of file XMLBool.cs.
XMLStorage::XMLBool::XMLBool | ( | bool | value ) | [inline] |
XMLStorage::XMLBool::XMLBool | ( | string | value ) | [inline] |
Definition at line 52 of file XMLBool.cs.
References init().
{ init(value, false); }
XMLStorage::XMLBool::XMLBool | ( | string | value, |
bool | def | ||
) | [inline] |
Definition at line 57 of file XMLBool.cs.
References init().
{ init(value, def); }
XMLStorage::XMLBool::XMLBool | ( | AbstractXMLNode | node, |
string | attrName | ||
) | [inline] |
Definition at line 69 of file XMLBool.cs.
References init().
{ init(node, attrName, false); }
XMLStorage::XMLBool::XMLBool | ( | XMLPos | pos, |
string | attrName | ||
) | [inline] |
Definition at line 74 of file XMLBool.cs.
References XMLStorage::XMLPos::cur(), and init().
{ init(pos.cur(), attrName, false); }
XMLStorage::XMLBool::XMLBool | ( | XMLPos | pos, |
string | attrName, | ||
bool | def | ||
) | [inline] |
Definition at line 79 of file XMLBool.cs.
References XMLStorage::XMLPos::cur(), and init().
{ init(pos.cur(), attrName, def); }
XMLStorage::XMLBool::XMLBool | ( | XMLStreamReader | reader, |
string | attrName | ||
) | [inline] |
Definition at line 84 of file XMLBool.cs.
References XMLStorage::XMLStreamReader::getNode(), and init().
{ init(reader.getNode(), attrName, false); }
XMLStorage::XMLBool::XMLBool | ( | XMLStreamReader | reader, |
string | attrName, | ||
bool | def | ||
) | [inline] |
Definition at line 89 of file XMLBool.cs.
References XMLStorage::XMLStreamReader::getNode(), and init().
{ init(reader.getNode(), attrName, def); }
XMLStorage::XMLBool::XMLBool | ( | AbstractXMLNode | node, |
string | attrName, | ||
bool | def | ||
) | [inline] |
Definition at line 94 of file XMLBool.cs.
References init().
{ init(node, attrName, def); }
bool XMLStorage::XMLBool::boolValue | ( | ) | [inline] |
void XMLStorage::XMLBool::init | ( | AbstractXMLNode | node, |
string | attrName, | ||
bool | def | ||
) | [inline, private] |
Definition at line 99 of file XMLBool.cs.
References _value, and XMLStorage::AbstractXMLNode::get().
{ string value = node.get(attrName); if (value.Length==0 || !bool.TryParse(value, out _value)) _value = def; }
void XMLStorage::XMLBool::init | ( | string | value, |
bool | def | ||
) | [inline, private] |
Definition at line 62 of file XMLBool.cs.
References _value.
Referenced by XMLBool().
{ if (string.IsNullOrEmpty(value) || !bool.TryParse(value, out _value)) _value = def; }
override string XMLStorage::XMLBool::ToString | ( | ) | [inline] |
bool XMLStorage::XMLBool::_value [protected] |
Definition at line 118 of file XMLBool.cs.
Referenced by boolValue(), init(), ToString(), and XMLBool().