Drag[en]gine Script Module DragonScript
1.23
|
Public Member Functions | |
Constructors | |
EasyXMLElement | new (EasyXMLElementType type) |
Create element. More... | |
Management | |
int | getLine () |
Line number of tag. More... | |
int | getPosition () |
Position on line of tag. More... | |
EasyXMLElementType | getType () |
Type of element. More... | |
String | getTagName () |
Name of tag. More... | |
void | setTagName (String name) |
Set name of tag. More... | |
String | getCDataContent () |
Character data content. More... | |
void | setCDataContent (String content) |
Set character data content. More... | |
String | getComment () |
Comment. More... | |
void | setComment (String comment) |
Set comment. More... | |
Attributes | |
int | getAttributeCount () |
Number of attributes. More... | |
String | getAttributeNamed (String name) |
Named attribute. More... | |
int | getAttributeIntNamed (String name) |
Named integer attribute. More... | |
float | getAttributeFloatNamed (String name) |
Named float attribute. More... | |
bool | getAttributeBoolNamed (String name) |
Named boolean attribute. More... | |
bool | hasAttributeNamed (String name) |
Named attribute is present. More... | |
void | setAttribute (String name, String value) |
Set attribute. More... | |
void | setAttribute (String name, int value) |
Set attribute. More... | |
void | setAttribute (String name, float value) |
Set attribute. More... | |
void | setAttribute (String name, bool value) |
Set attribute. More... | |
void | removeAttributeNamed (String name) |
Remove named attribute if present. More... | |
void | removeAllAttributes () |
Remove all attributes. More... | |
Child elements | |
int | getElementCount () |
Number of child elements. More... | |
void | hasElement (EasyXMLElement child) |
Child element is present. More... | |
EasyXMLElement | getElementAt (int index) |
Child element at index. More... | |
void | addElement (EasyXMLElement child) |
Add child element. More... | |
void | removeElement (EasyXMLElement child) |
Remove child element. More... | |
void | removeAllElements () |
Remove all child elements. More... | |
EasyXMLElement | addTag (String name) |
Add element of type TAG with name. More... | |
EasyXMLElement | addDataTag (String name, String value) |
Add tag with name and string CData child element. More... | |
EasyXMLElement | addDataTag (String name, int value) |
Add tag with name and integer CData child element. More... | |
EasyXMLElement | addDataTag (String name, float value) |
Add tag with name and float CData child element. More... | |
EasyXMLElement | addDataTag (String name, bool value) |
Add tag with name and boolean CData child element. More... | |
EasyXMLElement | addCData (String value) |
Add CData child element. More... | |
void | addComment (String comment) |
Add comment element. More... | |
String | getFirstCData () |
First child CData or empty string if absent. More... | |
int | getFirstCDataInt () |
First child CData converted to integer or 0 if absent. More... | |
float | getFirstCDataFloat () |
First child CData converted to string or 0.0 if absent. More... | |
bool | getFirstCDataBool () |
First child CData converted to boolean or false if absent. More... | |
void | forEachTag (Block ablock) |
Visit all TAG type elements with block. More... | |
bool | hasTags () |
Elements has at least one child element of type tag. More... | |
XML element.
This is a native class.
EasyXMLElement Dragengine.XML.EasyXMLElement.addCData | ( | String | value | ) |
Add CData child element.
void Dragengine.XML.EasyXMLElement.addComment | ( | String | comment | ) |
Add comment element.
EasyXMLElement Dragengine.XML.EasyXMLElement.addDataTag | ( | String | name, |
bool | value | ||
) |
Add tag with name and boolean CData child element.
CData contains "true" or "false" as text.
EasyXMLElement Dragengine.XML.EasyXMLElement.addDataTag | ( | String | name, |
float | value | ||
) |
Add tag with name and float CData child element.
EasyXMLElement Dragengine.XML.EasyXMLElement.addDataTag | ( | String | name, |
int | value | ||
) |
Add tag with name and integer CData child element.
EasyXMLElement Dragengine.XML.EasyXMLElement.addDataTag | ( | String | name, |
String | value | ||
) |
Add tag with name and string CData child element.
void Dragengine.XML.EasyXMLElement.addElement | ( | EasyXMLElement | child | ) |
Add child element.
Elements can only be child of one parent at each time.
EInvalidParam | Element is already a child of another parent. |
EasyXMLElement Dragengine.XML.EasyXMLElement.addTag | ( | String | name | ) |
Add element of type TAG with name.
void Dragengine.XML.EasyXMLElement.forEachTag | ( | Block | ablock | ) |
Visit all TAG type elements with block.
Block receives the parameters EasyXMLElement element and String tagName. The typical usage scenario is quickly reading a tag content like this:
bool Dragengine.XML.EasyXMLElement.getAttributeBoolNamed | ( | String | name | ) |
Named boolean attribute.
Value with text "true", "yes" or "1" are converted to true. Value with text "false", "no" or "0" are converted to false. All other values are converted to false.
EInvalidParam | Named attribute is absent. |
int Dragengine.XML.EasyXMLElement.getAttributeCount | ( | ) |
Number of attributes.
float Dragengine.XML.EasyXMLElement.getAttributeFloatNamed | ( | String | name | ) |
Named float attribute.
EInvalidParam | Named attribute is absent. |
int Dragengine.XML.EasyXMLElement.getAttributeIntNamed | ( | String | name | ) |
Named integer attribute.
EInvalidParam | Named attribute is absent. |
String Dragengine.XML.EasyXMLElement.getAttributeNamed | ( | String | name | ) |
Named attribute.
EInvalidParam | Named attribute is absent. |
String Dragengine.XML.EasyXMLElement.getCDataContent | ( | ) |
Character data content.
String Dragengine.XML.EasyXMLElement.getComment | ( | ) |
Comment.
EasyXMLElement Dragengine.XML.EasyXMLElement.getElementAt | ( | int | index | ) |
Child element at index.
EOutOfBoundary | index is less than 0 or greater than or equal to getElementCount(). |
int Dragengine.XML.EasyXMLElement.getElementCount | ( | ) |
Number of child elements.
String Dragengine.XML.EasyXMLElement.getFirstCData | ( | ) |
First child CData or empty string if absent.
bool Dragengine.XML.EasyXMLElement.getFirstCDataBool | ( | ) |
First child CData converted to boolean or false if absent.
CData with text "true", "yes" or "1" are converted to true. CData with text "false", "no" or "0" are converted to false. All other CData text are converted to false.
float Dragengine.XML.EasyXMLElement.getFirstCDataFloat | ( | ) |
First child CData converted to string or 0.0 if absent.
int Dragengine.XML.EasyXMLElement.getFirstCDataInt | ( | ) |
First child CData converted to integer or 0 if absent.
int Dragengine.XML.EasyXMLElement.getLine | ( | ) |
Line number of tag.
int Dragengine.XML.EasyXMLElement.getPosition | ( | ) |
Position on line of tag.
String Dragengine.XML.EasyXMLElement.getTagName | ( | ) |
Name of tag.
EasyXMLElementType Dragengine.XML.EasyXMLElement.getType | ( | ) |
Type of element.
bool Dragengine.XML.EasyXMLElement.hasAttributeNamed | ( | String | name | ) |
Named attribute is present.
void Dragengine.XML.EasyXMLElement.hasElement | ( | EasyXMLElement | child | ) |
Child element is present.
bool Dragengine.XML.EasyXMLElement.hasTags | ( | ) |
Elements has at least one child element of type tag.
EasyXMLElement Dragengine.XML.EasyXMLElement.new | ( | EasyXMLElementType | type | ) |
Create element.
void Dragengine.XML.EasyXMLElement.removeAllAttributes | ( | ) |
Remove all attributes.
void Dragengine.XML.EasyXMLElement.removeAllElements | ( | ) |
Remove all child elements.
void Dragengine.XML.EasyXMLElement.removeAttributeNamed | ( | String | name | ) |
Remove named attribute if present.
void Dragengine.XML.EasyXMLElement.removeElement | ( | EasyXMLElement | child | ) |
Remove child element.
void Dragengine.XML.EasyXMLElement.setAttribute | ( | String | name, |
bool | value | ||
) |
Set attribute.
If attribute is present its value is changed. Otherwise a new attribute is added. Value contains "true" or "false".
void Dragengine.XML.EasyXMLElement.setAttribute | ( | String | name, |
float | value | ||
) |
Set attribute.
If attribute is present its value is changed. Otherwise a new attribute is added.
void Dragengine.XML.EasyXMLElement.setAttribute | ( | String | name, |
int | value | ||
) |
Set attribute.
If attribute is present its value is changed. Otherwise a new attribute is added.
void Dragengine.XML.EasyXMLElement.setAttribute | ( | String | name, |
String | value | ||
) |
Set attribute.
If attribute is present its value is changed. Otherwise a new attribute is added.
void Dragengine.XML.EasyXMLElement.setCDataContent | ( | String | content | ) |
Set character data content.
void Dragengine.XML.EasyXMLElement.setComment | ( | String | comment | ) |
Set comment.
void Dragengine.XML.EasyXMLElement.setTagName | ( | String | name | ) |
Set name of tag.