Public Member Functions | Protected Attributes | Private Attributes

XMLStorage::XMLStreamNode Class Reference

XMLStreamNode is used to hold the data of the current XML Node in XMLStreamReader. More...

Inheritance diagram for XMLStorage::XMLStreamNode:
Inheritance graph
[legend]
Collaboration diagram for XMLStorage::XMLStreamNode:
Collaboration graph
[legend]

List of all members.

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 = ""

Detailed Description

XMLStreamNode is used to hold the data of the current XML Node in XMLStreamReader.

Definition at line 48 of file XMLStreamNode.cs.


Constructor & Destructor Documentation

XMLStorage::XMLStreamNode::XMLStreamNode (  ) [inline]

Empty XMLStreamNode default constructor.

Definition at line 55 of file XMLStreamNode.cs.

    {
    }

Member Function Documentation

void XMLStorage::XMLStreamNode::assign ( string  name ) [inline]
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);
    }

Here is the call graph for this function:

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]
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]
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;
    }

Member Data Documentation

Dictionary<string, string> XMLStorage::AbstractXMLNode::_attributes = new Dictionary<string, string>() [protected, inherited]
string XMLStorage::XMLStreamNode::_name = "" [private]

Definition at line 50 of file XMLStreamNode.cs.

Referenced by assign(), getName(), and ToString().


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