North State Framework in C#
V3.0.0
An object-oriented framework for implementing UML state machines.
|
Represents a simple in-memory xml document editor. More...
Public Types | |
enum | ErrorStatus { NoError, EmptyDocument, EmptyElement, ParseError, FileError, BadValue } |
Represents xml document error status. More... | |
Public Member Functions | |
NSFXMLDocument () | |
Creates an xml document. More... | |
NSFXMLDocument (NSFString rootTag) | |
Creates an xml document. More... | |
NSFXMLDocument (NSFXMLDocument copyDocument) | |
Creates an xml document. More... | |
void | addChildElementBack (NSFString childTag) |
Adds an element to the back of the current element's child elements More... | |
void | addChildElementBack (NSFString childTag, NSFString childText) |
Adds an element to the back of the current element's child elements More... | |
void | addChildElementBack< ValueType > (NSFString childTag, ValueType value) |
Adds an element to the back of the current element's child elements More... | |
bool | addChildElementBack (NSFXMLDocument document) |
Adds an xml document to the back of the current element's child elements More... | |
bool | addChildElementBack (NSFXMLElement childElement) |
Adds an element to the back of the current element's child elements More... | |
void | addChildElementFront (NSFString childTag) |
Adds an element to the front of the current element's child elements More... | |
void | addChildElementFront (NSFString childTag, NSFString childText) |
Adds an element to the front of the current element's child elements More... | |
void | addChildElementFront< ValueType > (NSFString childTag, ValueType value) |
Adds an element to the front of the current element's child elements More... | |
bool | addChildElementFront (NSFXMLDocument document) |
Adds an xml document to the front of the current element's child elements More... | |
bool | addChildElementFront (NSFXMLElement childElement) |
Adds an element to the front of the current element's child elements More... | |
void | addRootElement (NSFString rootTag) |
Adds a root element and sets the current element and bookmark element to the root element. More... | |
bool | atBookmarkElement () |
Checks if at the bookmark element. More... | |
bool | atRootElement () |
Checks if at the root element. More... | |
bool | containsChildElement () |
Checks if the current elements contains a child element. More... | |
bool | containsChildElement (NSFString childTag) |
Checks if the current elements contains a child element with the specified tag. More... | |
bool | deleteChildElementBack () |
Deletes the current element's last child element. More... | |
bool | deleteChildElementFront () |
Deletes the current element's first child element. More... | |
bool | deleteCurrentElement () |
Deletes the current element. More... | |
bool | getChildElementBoolean (NSFString childTag, ref bool value) |
Gets the boolean value of the child element with the specified tag. More... | |
void | getChildElementBoolean (NSFString childTag, ref bool value, bool defaultValue) |
Gets the boolean value of the child element with the specified tag or the default value if no child found. More... | |
bool | getChildElementText (NSFString childTag, NSFString text) |
Gets the text of the child element with the specified tag. More... | |
void | getChildElementText (NSFString childTag, NSFString text, NSFString defaultText) |
Gets the text of the child element with the specified tag or the default text if no child found. More... | |
bool | getChildElementValue< ValueType > (NSFString childTag, ref ValueType value) |
Gets the numeric value of the child element with the specified tag. More... | |
void | getChildElementValue< ValueType > (NSFString childTag, ref ValueType value, ValueType defaultValue) |
Gets the numeric value of the child element with the specified tag or the default value if no child found. More... | |
bool | getCurrentElementBoolean (ref bool value) |
Gets the current element's boolean value. More... | |
bool | getCurrentElementTag (NSFString tag) |
Gets the current element's tag. More... | |
bool | getCurrentElementText (NSFString text) |
Gets the current element's text. More... | |
bool | getCurrentElementValue< ValueType > (ref ValueType value) |
Gets the current element's numeric value. More... | |
ErrorStatus | getErrorStatus () |
Gets the error status of the last operation. More... | |
bool | getNumberOfChildElements (out int numberOfChildElements) |
Gets the number of child elements. More... | |
bool | jumpToBookmarkElement () |
Moves the current element pointer to the bookmarked element. More... | |
bool | jumpToChildElement (NSFString childTag) |
Moves the current element pointer to the first child element with the specified tag. More... | |
bool | jumpToChildElementBack () |
Moves the current element pointer to the last child element of the current element. More... | |
bool | jumpToChildElementFront () |
Moves the current element pointer to the first child element of the current element. More... | |
bool | jumpToNextElement () |
Moves the current element pointer to the next element at the same level. More... | |
bool | jumpToNextElement (NSFString nextTag) |
Moves the current element pointer to the next element with the specified tag at the same level. More... | |
bool | jumpToParentElement () |
Moves the current element pointer to the parent of the current element. More... | |
bool | jumpToParentElement (NSFString parentTag) |
Moves the current element pointer to the parent of the current element with the specified tag. More... | |
bool | jumpToRootElement () |
Moves the current element pointer to the root element. More... | |
bool | loadBuffer (NSFString buffer) |
Populates the document with xml formatted text in the specified buffer. More... | |
void | loadDocument (NSFXMLDocument copyDocument) |
Populates the document with xml from specified xml document. More... | |
bool | loadFile (NSFString fileName) |
Populates the document with xml formatted text in the specified file. More... | |
void | reset () |
Sets the current and bookmark element to the root element. More... | |
bool | save (NSFString fileName) |
Saves the xml document to the specified file name. More... | |
void | setBookmarkElement () |
Sets the bookmark element to the current element. More... | |
void | setChildElementText (NSFString childTag, NSFString text) |
Sets the text of the specified child element or creates a child element if no match is found. More... | |
void | setChildElementValue< ValueType > (NSFString childTag, ValueType value) |
Sets the text of the specified child element to the specified numeric value, converted to a string, or creates a child element if no match is found. More... | |
bool | setCurrentElementTag (NSFString tag) |
Sets the current element's tag. More... | |
bool | setCurrentElementText (NSFString text) |
Sets the current element's text. More... | |
bool | setCurrentElementValue< ValueType > (ValueType value) |
Sets the current element's text to the specified value, converted to a string. More... | |
Represents a simple in-memory xml document editor.
This class is not thread safe.
enum ErrorStatus |
NSFXMLDocument | ( | ) |
Creates an xml document.
NSFXMLDocument | ( | NSFString | rootTag | ) |
Creates an xml document.
rootTag | The string for the root element of the document. |
NSFXMLDocument | ( | NSFXMLDocument | copyDocument | ) |
Creates an xml document.
copyDocument | The document to copy. |
void addChildElementBack | ( | NSFString | childTag | ) |
Adds an element to the back of the current element's child elements
childTag | The tag for the element. |
Adds an element to the back of the current element's child elements
childTag | The tag for the element. |
childText | The text for the element. |
bool addChildElementBack | ( | NSFXMLDocument | document | ) |
Adds an xml document to the back of the current element's child elements
document | The document to add. |
bool addChildElementBack | ( | NSFXMLElement | childElement | ) |
Adds an element to the back of the current element's child elements
childElement | The element to add. |
void addChildElementBack< ValueType > | ( | NSFString | childTag, |
ValueType | value | ||
) |
Adds an element to the back of the current element's child elements
childTag | The tag for the element. |
value | The value (converted to string) for the element. |
void addChildElementFront | ( | NSFString | childTag | ) |
Adds an element to the front of the current element's child elements
childTag | The tag for the element. |
Adds an element to the front of the current element's child elements
childTag | The tag for the element. |
childText | The text for the element. |
bool addChildElementFront | ( | NSFXMLDocument | document | ) |
Adds an xml document to the front of the current element's child elements
document | The document to add. |
bool addChildElementFront | ( | NSFXMLElement | childElement | ) |
Adds an element to the front of the current element's child elements
childElement | The element to add. |
void addChildElementFront< ValueType > | ( | NSFString | childTag, |
ValueType | value | ||
) |
Adds an element to the front of the current element's child elements
childTag | The tag for the element. |
value | The value (converted to string) for the element. |
void addRootElement | ( | NSFString | rootTag | ) |
Adds a root element and sets the current element and bookmark element to the root element.
bool atBookmarkElement | ( | ) |
Checks if at the bookmark element.
bool atRootElement | ( | ) |
Checks if at the root element.
bool containsChildElement | ( | ) |
Checks if the current elements contains a child element.
bool containsChildElement | ( | NSFString | childTag | ) |
Checks if the current elements contains a child element with the specified tag.
childTag | The tag for the child element. |
bool deleteChildElementBack | ( | ) |
Deletes the current element's last child element.
bool deleteChildElementFront | ( | ) |
Deletes the current element's first child element.
bool deleteCurrentElement | ( | ) |
Deletes the current element.
bool getChildElementBoolean | ( | NSFString | childTag, |
ref bool | value | ||
) |
Gets the boolean value of the child element with the specified tag.
childTag | The child element's tag. |
value | The child element's boolean value. |
This operation looks for (case insensitive): "true", "t", or "1" for true; "false", "f", or "0" for false.
void getChildElementBoolean | ( | NSFString | childTag, |
ref bool | value, | ||
bool | defaultValue | ||
) |
Gets the boolean value of the child element with the specified tag or the default value if no child found.
childTag | The child element's tag. |
value | The child element's boolean value. |
defaultValue | The default value returned in value argument if child not found. |
This operation looks for (case insensitive): "true", "t", or "1" for true; "false", "f", or "0" for false.
Gets the text of the child element with the specified tag.
childTag | The child element's tag. |
text | The child element's text. |
Gets the text of the child element with the specified tag or the default text if no child found.
childTag | The child element's tag. |
text | The child element's text. |
defaultText | The default text returned in text argument if child not found. |
bool getChildElementValue< ValueType > | ( | NSFString | childTag, |
ref ValueType | value | ||
) |
Gets the numeric value of the child element with the specified tag.
childTag | The child element's tag. |
value | The child element's value. |
ValueType | : | IConvertible |
void getChildElementValue< ValueType > | ( | NSFString | childTag, |
ref ValueType | value, | ||
ValueType | defaultValue | ||
) |
Gets the numeric value of the child element with the specified tag or the default value if no child found.
childTag | The child element's tag. |
value | The child element's value. |
defaultValue | The default value returned in value argument if child not found. |
ValueType | : | IConvertible |
bool getCurrentElementBoolean | ( | ref bool | value | ) |
Gets the current element's boolean value.
value | The current element's boolean value. |
This operation looks for (case insensitive): "true", "t", or "1" for true; "false", "f", or "0" for false.
bool getCurrentElementTag | ( | NSFString | tag | ) |
Gets the current element's tag.
tag | The current element's tag. |
bool getCurrentElementText | ( | NSFString | text | ) |
Gets the current element's text.
text | The current element's text. |
bool getCurrentElementValue< ValueType > | ( | ref ValueType | value | ) |
Gets the current element's numeric value.
value | The current element's value. |
ValueType | : | IConvertible |
ErrorStatus getErrorStatus | ( | ) |
Gets the error status of the last operation.
Boolean methods that return false set the error status of the document.
bool getNumberOfChildElements | ( | out int | numberOfChildElements | ) |
Gets the number of child elements.
numberOfChildElements | The number of child elements. |
bool jumpToBookmarkElement | ( | ) |
Moves the current element pointer to the bookmarked element.
The bookmark provides a mechanism for jumping back to a specific element in the document.
bool jumpToChildElement | ( | NSFString | childTag | ) |
Moves the current element pointer to the first child element with the specified tag.
childTag | The child tag to find. |
bool jumpToChildElementBack | ( | ) |
Moves the current element pointer to the last child element of the current element.
bool jumpToChildElementFront | ( | ) |
Moves the current element pointer to the first child element of the current element.
bool jumpToNextElement | ( | ) |
Moves the current element pointer to the next element at the same level.
bool jumpToNextElement | ( | NSFString | nextTag | ) |
Moves the current element pointer to the next element with the specified tag at the same level.
nextTag | The tag to find. |
bool jumpToParentElement | ( | ) |
Moves the current element pointer to the parent of the current element.
bool jumpToParentElement | ( | NSFString | parentTag | ) |
Moves the current element pointer to the parent of the current element with the specified tag.
parentTag | The tag to find. |
bool jumpToRootElement | ( | ) |
Moves the current element pointer to the root element.
bool loadBuffer | ( | NSFString | buffer | ) |
Populates the document with xml formatted text in the specified buffer.
buffer | The buffer to load. |
void loadDocument | ( | NSFXMLDocument | copyDocument | ) |
Populates the document with xml from specified xml document.
copyDocument | The file to copy. |
bool loadFile | ( | NSFString | fileName | ) |
Populates the document with xml formatted text in the specified file.
fileName | The file to load. |
void reset | ( | ) |
Sets the current and bookmark element to the root element.
bool save | ( | NSFString | fileName | ) |
Saves the xml document to the specified file name.
fileName | The name of the file. |
void setBookmarkElement | ( | ) |
Sets the bookmark element to the current element.
The bookmark provides a mechanism for jumping back to a specific element in the document.
Sets the text of the specified child element or creates a child element if no match is found.
childTag | The child element's tag. |
text | The child element's text. |
void setChildElementValue< ValueType > | ( | NSFString | childTag, |
ValueType | value | ||
) |
Sets the text of the specified child element to the specified numeric value, converted to a string, or creates a child element if no match is found.
childTag | The child element's tag. |
value | The child element's value. |
ValueType | : | IConvertible |
bool setCurrentElementTag | ( | NSFString | tag | ) |
Sets the current element's tag.
tag | The current element's tag. |
bool setCurrentElementText | ( | NSFString | text | ) |
Sets the current element's text.
text | The current element's text. |
bool setCurrentElementValue< ValueType > | ( | ValueType | value | ) |
Sets the current element's text to the specified value, converted to a string.
value | The current element's value. |