XMLStreamNode is used to hold the data of the current XML Node in XMLStreamReader. More...
Public Member Functions | |
XMLStreamNode () | |
Empty XMLStreamNode default constructor. | |
override string | getName () |
override string | ToString () |
void | assign (string name) |
void | setContent (string content) |
override string | get (string attrName) |
read only access to an attribute | |
override string | get (string attrName, string def) |
read only access to an attribute with default value | |
override string | getContent () |
Return content data. | |
XMLInt | getInt (string attrName) |
XMLInt | getInt (string attrName, int def) |
XMLDecimal | getNumber (string attrName) |
XMLDecimal | getNumber (string attrName, decimal def) |
XMLBool | getBool (string attrName) |
XMLBool | getBool (string attrName, bool def) |
XMLString | getString (string attrName) |
XMLString | getString (string attrName, string def) |
void | setAttributes (XmlReader reader) |
bool | hasAttributes () |
Protected Attributes | |
Dictionary< string, string > | _attributes = new Dictionary<string, string>() |
Private Attributes | |
string | _name = "" |
XMLStreamNode is used to hold the data of the current XML Node in XMLStreamReader.
Definition at line 48 of file XMLStreamNode.cs.
XMLStorage::XMLStreamNode::XMLStreamNode | ( | ) | [inline] |
void XMLStorage::XMLStreamNode::assign | ( | string | name ) | [inline] |
Definition at line 69 of file XMLStreamNode.cs.
References XMLStorage::AbstractXMLNode::_attributes, XMLStorage::AbstractXMLNode::_content, and _name.
Referenced by XMLStorage::XMLStreamReader::endElement(), and XMLStorage::XMLStreamReader::startElement().
{ _name = name; _content = ""; _attributes.Clear(); }
override string XMLStorage::XMLStreamNode::get | ( | string | attrName ) | [inline, virtual] |
read only access to an attribute
Implements XMLStorage::AbstractXMLNode.
Definition at line 82 of file XMLStreamNode.cs.
References XMLStorage::AbstractXMLNode::_attributes.
Referenced by XMLStorage::XMLStreamReader::find(), and XMLStorage::XMLStreamReader::get().
{ string found; if (_attributes.TryGetValue(attrName, out found)) return found; else return ""; }
override string XMLStorage::XMLStreamNode::get | ( | string | attrName, |
string | def | ||
) | [inline, virtual] |
read only access to an attribute with default value
Implements XMLStorage::AbstractXMLNode.
Definition at line 93 of file XMLStreamNode.cs.
References XMLStorage::AbstractXMLNode::_attributes.
{ string found; if (_attributes.TryGetValue(attrName, out found)) return found; else return def; }
XMLBool XMLStorage::AbstractXMLNode::getBool | ( | string | attrName ) | [inline, inherited] |
Definition at line 85 of file AbstractXMLNode.cs.
{ return new XMLBool(this, attrName); }
XMLBool XMLStorage::AbstractXMLNode::getBool | ( | string | attrName, |
bool | def | ||
) | [inline, inherited] |
Definition at line 89 of file AbstractXMLNode.cs.
{ return new XMLBool(this, attrName, def); }
override string XMLStorage::XMLStreamNode::getContent | ( | ) | [inline, virtual] |
Return content data.
Implements XMLStorage::AbstractXMLNode.
Definition at line 106 of file XMLStreamNode.cs.
References XMLStorage::AbstractXMLNode::_content, and XMLStorage::XMLHelper::decodeXMLString().
Referenced by XMLStorage::XMLStreamReader::getContent().
{ return XMLHelper.decodeXMLString(_content); }
XMLInt XMLStorage::AbstractXMLNode::getInt | ( | string | attrName ) | [inline, inherited] |
Definition at line 67 of file AbstractXMLNode.cs.
{ return new XMLInt(this, attrName); }
XMLInt XMLStorage::AbstractXMLNode::getInt | ( | string | attrName, |
int | def | ||
) | [inline, inherited] |
Definition at line 71 of file AbstractXMLNode.cs.
{ return new XMLInt(this, attrName, def); }
override string XMLStorage::XMLStreamNode::getName | ( | ) | [inline, virtual] |
Implements XMLStorage::AbstractXMLNode.
Definition at line 59 of file XMLStreamNode.cs.
References _name.
Referenced by XMLStorage::XMLStreamReader::filterChildren(), XMLStorage::XMLStreamReader::find(), XMLStorage::XMLStreamReader::getNodeName(), XMLStorage::XMLStreamReader::handlePendingEndElement(), and XMLStorage::XMLStreamReader::isAtNode().
{ return _name; }
XMLDecimal XMLStorage::AbstractXMLNode::getNumber | ( | string | attrName, |
decimal | def | ||
) | [inline, inherited] |
Definition at line 80 of file AbstractXMLNode.cs.
{ return new XMLDecimal(this, attrName, def); }
XMLDecimal XMLStorage::AbstractXMLNode::getNumber | ( | string | attrName ) | [inline, inherited] |
Definition at line 76 of file AbstractXMLNode.cs.
{ return new XMLDecimal(this, attrName); }
XMLString XMLStorage::AbstractXMLNode::getString | ( | string | attrName ) | [inline, inherited] |
Definition at line 94 of file AbstractXMLNode.cs.
{ return new XMLString(this, attrName); }
XMLString XMLStorage::AbstractXMLNode::getString | ( | string | attrName, |
string | def | ||
) | [inline, inherited] |
Definition at line 98 of file AbstractXMLNode.cs.
{ return new XMLString(this, attrName, def); }
bool XMLStorage::AbstractXMLNode::hasAttributes | ( | ) | [inline, inherited] |
Definition at line 117 of file AbstractXMLNode.cs.
References XMLStorage::AbstractXMLNode::_attributes.
Referenced by XMLStorage::XMLStreamReader::handlePendingEndElement().
{ return _attributes.Count > 0; }
void XMLStorage::AbstractXMLNode::setAttributes | ( | XmlReader | reader ) | [inline, inherited] |
Definition at line 103 of file AbstractXMLNode.cs.
References XMLStorage::AbstractXMLNode::_attributes.
Referenced by XMLStorage::XMLStreamReader::startElement(), and XMLStorage::XMLDocReader::startElement().
{ while(reader.MoveToNextAttribute()) { string attrNS = reader.NamespaceURI; string attrName = reader.Name; string attrValue = reader.Value; if (attrNS.Length > 0) attrName = attrNS + ":" + attrName; _attributes.Add(attrName, attrValue); } }
void XMLStorage::XMLStreamNode::setContent | ( | string | content ) | [inline] |
Definition at line 76 of file XMLStreamNode.cs.
References XMLStorage::AbstractXMLNode::_content.
Referenced by XMLStorage::XMLStreamReader::findNode().
{ _content = content; }
override string XMLStorage::XMLStreamNode::ToString | ( | ) | [inline, virtual] |
Implements XMLStorage::AbstractXMLNode.
Definition at line 64 of file XMLStreamNode.cs.
References _name.
Referenced by XMLStorage::XMLStreamReader::ToString().
{ return _name; }
Dictionary<string, string> XMLStorage::AbstractXMLNode::_attributes = new Dictionary<string, string>() [protected, inherited] |
Definition at line 52 of file AbstractXMLNode.cs.
Referenced by assign(), XMLStorage::XMLNode::assign(), XMLStorage::XMLNode::clear(), get(), XMLStorage::XMLNode::get(), XMLStorage::AbstractXMLNode::hasAttributes(), XMLStorage::XMLNode::prettyWriteWorker(), XMLStorage::XMLNode::put(), XMLStorage::AbstractXMLNode::setAttributes(), XMLStorage::XMLNode::smartWriteWorker(), and XMLStorage::XMLNode::writeWorker().
string XMLStorage::XMLStreamNode::_name = "" [private] |
Definition at line 50 of file XMLStreamNode.cs.
Referenced by assign(), getName(), and ToString().