|
Drag[en]gine Script Module DragonScript 1.35
|
Public Member Functions | |
Constructors | |
| EasyXMLElement | new (EasyXMLElementType type) |
| Create element. | |
Management | |
| int | getLine () |
| Line number of tag. | |
| int | getPosition () |
| Position on line of tag. | |
| EasyXMLElementType | getType () |
| Type of element. | |
| String | getTagName () |
| Name of tag. | |
| void | setTagName (String name) |
| Set name of tag. | |
| String | getCDataContent () |
| Character data content. | |
| void | setCDataContent (String content) |
| Set character data content. | |
| String | getComment () |
| Comment. | |
| void | setComment (String comment) |
| Set comment. | |
Attributes | |
| int | getAttributeCount () |
| Number of attributes. | |
| String | getAttributeNamed (String name) |
| Named attribute. | |
| int | getAttributeIntNamed (String name) |
| Named integer attribute. | |
| float | getAttributeFloatNamed (String name) |
| Named float attribute. | |
| bool | getAttributeBoolNamed (String name) |
| Named boolean attribute. | |
| bool | hasAttributeNamed (String name) |
| Named attribute is present. | |
| void | setAttribute (String name, String value) |
| Set attribute. | |
| void | setAttribute (String name, int value) |
| Set attribute. | |
| void | setAttribute (String name, float value) |
| Set attribute. | |
| void | setAttribute (String name, bool value) |
| Set attribute. | |
| void | removeAttributeNamed (String name) |
| Remove named attribute if present. | |
| void | removeAllAttributes () |
| Remove all attributes. | |
Child elements | |
| int | getElementCount () |
| Number of child elements. | |
| void | hasElement (EasyXMLElement child) |
| Child element is present. | |
| EasyXMLElement | getElementAt (int index) |
| Child element at index. | |
| void | addElement (EasyXMLElement child) |
| Add child element. | |
| void | insertElement (EasyXMLElement child, int beforeIndex) |
| Insert child element before index. | |
| void | removeElement (EasyXMLElement child) |
| Remove child element. | |
| void | removeAllElements () |
| Remove all child elements. | |
| EasyXMLElement | addTag (String name) |
| Add element of type TAG with name. | |
| EasyXMLElement | addDataTag (String name, String value) |
| Add tag with name and string CData child element. | |
| EasyXMLElement | addDataTag (String name, int value) |
| Add tag with name and integer CData child element. | |
| EasyXMLElement | addDataTag (String name, float value) |
| Add tag with name and float CData child element. | |
| EasyXMLElement | addDataTag (String name, bool value) |
| Add tag with name and boolean CData child element. | |
| EasyXMLElement | addCData (String value) |
| Add CData child element. | |
| void | addComment (String comment) |
| Add comment element. | |
| String | getFirstCData () |
| First child CData or empty string if absent. | |
| int | getFirstCDataInt () |
| First child CData converted to integer or 0 if absent. | |
| float | getFirstCDataFloat () |
| First child CData converted to string or 0.0 if absent. | |
| bool | getFirstCDataBool () |
| First child CData converted to boolean or false if absent. | |
| void | forEachTag (Block ablock) |
| Visit all TAG type elements with block. | |
| bool | hasTags () |
| Elements has at least one child element of type tag. | |
XML element.
This is a native class.
| EasyXMLElement Dragengine.XML.EasyXMLElement.addCData | ( | String | value | ) |
| void Dragengine.XML.EasyXMLElement.addComment | ( | String | comment | ) |
| 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.
References addElement().
| 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.
References getElementAt().
Referenced by forEachTag(), and getFirstCDataBool().
| 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. |
References removeAllAttributes(), and removeAttributeNamed().
Referenced by addDataTag().
| EasyXMLElement Dragengine.XML.EasyXMLElement.addTag | ( | String | name | ) |
Add element of type TAG with name.
Referenced by getFirstCDataFloat().
| 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:
References addDataTag().
Referenced by hasTags().
| 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. |
References getAttributeIntNamed().
Referenced by setAttribute().
| int Dragengine.XML.EasyXMLElement.getAttributeCount | ( | ) |
| float Dragengine.XML.EasyXMLElement.getAttributeFloatNamed | ( | String | name | ) |
Named float attribute.
| EInvalidParam | Named attribute is absent. |
References getAttributeNamed().
Referenced by setAttribute().
| int Dragengine.XML.EasyXMLElement.getAttributeIntNamed | ( | String | name | ) |
Named integer attribute.
| EInvalidParam | Named attribute is absent. |
References getAttributeCount().
Referenced by getAttributeBoolNamed().
| String Dragengine.XML.EasyXMLElement.getAttributeNamed | ( | String | name | ) |
Named attribute.
| EInvalidParam | Named attribute is absent. |
References setComment().
Referenced by getAttributeFloatNamed().
| String Dragengine.XML.EasyXMLElement.getCDataContent | ( | ) |
Character data content.
Referenced by getComment().
| String Dragengine.XML.EasyXMLElement.getComment | ( | ) |
| EasyXMLElement Dragengine.XML.EasyXMLElement.getElementAt | ( | int | index | ) |
Child element at index.
| EOutOfBoundary | index is less than 0 or greater than or equal to getElementCount(). |
References setAttribute().
Referenced by addDataTag().
| int Dragengine.XML.EasyXMLElement.getElementCount | ( | ) |
| String Dragengine.XML.EasyXMLElement.getFirstCData | ( | ) |
First child CData or empty string if absent.
Referenced by hasTags().
| 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.
References addDataTag().
Referenced by hasTags().
| float Dragengine.XML.EasyXMLElement.getFirstCDataFloat | ( | ) |
First child CData converted to string or 0.0 if absent.
References addTag(), and removeAllElements().
Referenced by hasTags().
| int Dragengine.XML.EasyXMLElement.getFirstCDataInt | ( | ) |
First child CData converted to integer or 0 if absent.
References removeElement().
Referenced by hasTags().
| int Dragengine.XML.EasyXMLElement.getLine | ( | ) |
| int Dragengine.XML.EasyXMLElement.getPosition | ( | ) |
Position on line of tag.
Referenced by getType().
| String Dragengine.XML.EasyXMLElement.getTagName | ( | ) |
| EasyXMLElementType Dragengine.XML.EasyXMLElement.getType | ( | ) |
| bool Dragengine.XML.EasyXMLElement.hasAttributeNamed | ( | String | name | ) |
Named attribute is present.
Referenced by setAttribute().
| void Dragengine.XML.EasyXMLElement.hasElement | ( | EasyXMLElement | child | ) |
| bool Dragengine.XML.EasyXMLElement.hasTags | ( | ) |
Elements has at least one child element of type tag.
References addCData(), addComment(), forEachTag(), getFirstCData(), getFirstCDataBool(), getFirstCDataFloat(), getFirstCDataInt(), and hasTags().
Referenced by hasTags().
| void Dragengine.XML.EasyXMLElement.insertElement | ( | EasyXMLElement | child, |
| int | beforeIndex ) |
Insert child element before index.
Elements can only be child of one parent at each time.
| EInvalidParam | Element is already a child of another parent. |
| EInvalidParam | Index is less than 0. |
| EInvalidParam | Index is larger than or equal to getElementCount(). |
Referenced by addComment().
| EasyXMLElement Dragengine.XML.EasyXMLElement.new | ( | EasyXMLElementType | type | ) |
| void Dragengine.XML.EasyXMLElement.removeAllAttributes | ( | ) |
| void Dragengine.XML.EasyXMLElement.removeAllElements | ( | ) |
| void Dragengine.XML.EasyXMLElement.removeAttributeNamed | ( | String | name | ) |
Remove named attribute if present.
Referenced by addElement().
| void Dragengine.XML.EasyXMLElement.removeElement | ( | EasyXMLElement | child | ) |
| 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.
References getAttributeBoolNamed(), and hasAttributeNamed().
| 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.
References getAttributeFloatNamed().
Referenced by getElementAt(), getElementCount(), hasElement(), and removeAllAttributes().
| void Dragengine.XML.EasyXMLElement.setCDataContent | ( | String | content | ) |
| void Dragengine.XML.EasyXMLElement.setComment | ( | String | comment | ) |
| void Dragengine.XML.EasyXMLElement.setTagName | ( | String | name | ) |