C# Class LitDev.LDxml

Exibir arquivo Open project: litdev1/LitDev

Public Methods

Method Description
AddNode ( Primitive name, Primitive attributes, Primitive text, Primitive location ) : Primitive

Add a new node. The current node is unchanged, it is not updated to be the new node.

FirstChild ( ) : Primitive

Move the current node to the first child node if there is one.

FirstNode ( ) : Primitive

Set the current node to the first document node.

FromArray ( Primitive array ) : Primitive

Performs the inverse function of ToArray method, create an xml document from an array definition.

LastChild ( ) : Primitive

Move the current node to the last child node if there is one.

NextSibling ( ) : Primitive

Move the current node to the next sibling node if there is one.

Open ( Primitive fileName ) : Primitive

Open an existing xml file. This must be called before any other methods can be used.

Parent ( ) : Primitive

Move the current node to the parent node if there is one.

PreviousSibling ( ) : Primitive

Move the current node to the previous sibling node if there is one.

RemoveNode ( ) : Primitive

Remove the current node and all child nodes. The current node is reset to the previous sibling or parent node if no previous sibling exists.

Save ( Primitive fileName ) : Primitive

Save the current xml document to a file.

Switch ( Primitive docName ) : Primitive

Switch to another open xml document. The current node for all documents are preserved.

ToArray ( ) : Primitive

Convert the current xml document to a Small Basic array. The structure and depth of the array may be quite complex. Each node has optional arrays "Attributes", and "Children" or "Data". If there are are child nodes then they are indexed first by number to deliminate multiple children with the same name.

Private Methods

Method Description
fromArray ( Primitive array ) : void
toArray ( XmlNode node ) : Primitive

Method Details

AddNode() public static method

Add a new node. The current node is unchanged, it is not updated to be the new node.
public static AddNode ( Primitive name, Primitive attributes, Primitive text, Primitive location ) : Primitive
name Primitive The new node element name.
attributes Primitive An array of attributes (values indexed by attribute name) for the new node or "".
text Primitive Inner text for the new node or "".
location Primitive Where the node is inserted. /// "Append" - insert at the end of current node's child nodes. /// "Prepend" - insert at the start of current node's child nodes. /// "Before" - insert before the current node. /// "After" - insert after the current node.
return Primitive

FirstChild() public static method

Move the current node to the first child node if there is one.
public static FirstChild ( ) : Primitive
return Primitive

FirstNode() public static method

Set the current node to the first document node.
public static FirstNode ( ) : Primitive
return Primitive

FromArray() public static method

Performs the inverse function of ToArray method, create an xml document from an array definition.
public static FromArray ( Primitive array ) : Primitive
array Primitive A Small Basic array with the correct format.
return Primitive

LastChild() public static method

Move the current node to the last child node if there is one.
public static LastChild ( ) : Primitive
return Primitive

NextSibling() public static method

Move the current node to the next sibling node if there is one.
public static NextSibling ( ) : Primitive
return Primitive

Open() public static method

Open an existing xml file. This must be called before any other methods can be used.
public static Open ( Primitive fileName ) : Primitive
fileName Primitive The full path to the xml file to open. /// If this is "", then a new empty xml document is created.
return Primitive

Parent() public static method

Move the current node to the parent node if there is one.
public static Parent ( ) : Primitive
return Primitive

PreviousSibling() public static method

Move the current node to the previous sibling node if there is one.
public static PreviousSibling ( ) : Primitive
return Primitive

RemoveNode() public static method

Remove the current node and all child nodes. The current node is reset to the previous sibling or parent node if no previous sibling exists.
public static RemoveNode ( ) : Primitive
return Primitive

Save() public static method

Save the current xml document to a file.
public static Save ( Primitive fileName ) : Primitive
fileName Primitive The full path to the file to write the xml.
return Primitive

Switch() public static method

Switch to another open xml document. The current node for all documents are preserved.
public static Switch ( Primitive docName ) : Primitive
docName Primitive The name returned by Open method.
return Primitive

ToArray() public static method

Convert the current xml document to a Small Basic array. The structure and depth of the array may be quite complex. Each node has optional arrays "Attributes", and "Children" or "Data". If there are are child nodes then they are indexed first by number to deliminate multiple children with the same name.
public static ToArray ( ) : Primitive
return Primitive