Drag[en]gine Script Module DragonScript  1.23
Dragengine.LoadSave.BaseXmlLoader Class Reference
Inheritance diagram for Dragengine.LoadSave.BaseXmlLoader:
Dragengine.Audio.Announcer.LoadAnnouncer Dragengine.Audio.DynamicMusic.LoadDynamicMusic Dragengine.Audio.MaterialSounds.LoadImpactMaterialSound Dragengine.LoadSave.LoadAnimator Dragengine.LoadSave.LoadBehaviorTree Dragengine.LoadSave.LoadBindings Dragengine.LoadSave.LoadBorder Dragengine.LoadSave.LoadCamera Dragengine.LoadSave.LoadCanvasCreator Dragengine.LoadSave.LoadConversation Dragengine.LoadSave.LoadDecoration Dragengine.LoadSave.LoadElementClass Dragengine.LoadSave.LoadGuiTheme Dragengine.LoadSave.LoadHeightTerrain Dragengine.LoadSave.LoadMousePointer Dragengine.LoadSave.LoadParameterTree Dragengine.LoadSave.LoadParticleEmitter Dragengine.LoadSave.LoadSkinAnnotations Dragengine.LoadSave.LoadSky Dragengine.LoadSave.LoadSpeechAnimation Dragengine.LoadSave.LoadStateMachine Dragengine.LoadSave.LoadStyledTextDefinition Dragengine.LoadSave.LoadSynthesizer Dragengine.LoadSave.LoadWidgetDesigner Dragengine.LoadSave.LoadWorld

Public Member Functions

Console getConsole ()
 
String getName ()
 
int hexToInt (byte hex)
 
void logDeprecated (EasyXMLElement tag, String whatIsDeprecated)
 
void logDeprecated (EasyXMLElement tag, String whatIsDeprecated, String useWhatInstead)
 
void logDeprecatedTag (EasyXMLElement tag)
 
void logDuplicateObject (EasyXMLElement tag, String object, String identifier)
 Output error message duplicate object on the application console. More...
 
void logIncompatibleAttributes (EasyXMLElement tag, String attributeNames)
 
void logInvalidAttribute (String filename, EasyXMLElement tag, String attribute)
 Log attribute not allowed. More...
 
void logInvalidAttributeValue (EasyXMLElement tag, String attribute, String value)
 
void logInvalidEmptyString (EasyXMLElement tag)
 
void logInvalidValue (EasyXMLElement tag, String value)
 
void logInvalidValue (String filename, EasyXMLElement tag, String value)
 
void logLoadFileFailed (EasyXMLElement tag, String filename)
 
void logLoadingFailed (String filename)
 Log loading file failed with error log. More...
 
void logLoadingFromFile (String filename)
 
void logMissingAttribute (EasyXMLElement tag, String attrName)
 
void logMissingCData (EasyXMLElement tag)
 
void logMissingTag (String tagName)
 
void logNotSupported (EasyXMLElement tag, String whatIsNotSupported)
 
void logObjectExists (EasyXMLElement tag, String object, String value)
 Output error message value exists already on the application console. More...
 
void logParsingFailed (String errorLog)
 
void logSavingFailed (String filename)
 Log saving to file failed with error log. More...
 
void logSavingFromFile (String filename)
 Log filename on the application console. More...
 
void logUnknownTag (EasyXMLElement tag)
 
void logUnknownTag (String filename, EasyXMLElement tag)
 
BaseXmlLoader new (Console console, String name)
 
void printOnConsole (EasyXMLElement tag, String errorMessage)
 
void printOnConsole (String filename, EasyXMLElement tag, String message)
 Print message on console. More...
 
void printOnConsole (String filename, String message)
 Print message on console. More...
 
void printOnConsole (String message)
 
BorderSize readBorderSize (EasyXMLElement root)
 Read border size area. More...
 
int readCDataHex (EasyXMLElement tag)
 
Color readColor (EasyXMLElement root)
 
Color readColor (EasyXMLElement root, Color defaultColor)
 
ColorMatrix readColorMatrix (EasyXMLElement root)
 Read color matrix. More...
 
CurveBezier readCurveBezier (EasyXMLElement root)
 
void readCurveBezierPoint (EasyXMLElement root, CurveBezier curve)
 
DVector readDVector (EasyXMLElement root)
 
FloatRectArea readFloatRectArea (EasyXMLElement root)
 Read floating point rectangular area. More...
 
Font readFont (EasyXMLElement root)
 Parse font tag. More...
 
Font readFont (EasyXMLElement root, String basePath)
 Parse font tag. More...
 
String readMultilineString (EasyXMLElement root)
 Multi-line string or an empty string if absent. More...
 
Point readPoint (EasyXMLElement root)
 
Point3 readPoint3 (EasyXMLElement root)
 
RectArea readRectArea (EasyXMLElement root)
 Read rectangular area. More...
 
Vector readVector (EasyXMLElement root)
 
Vector2 readVector2 (EasyXMLElement root)
 
Vector2 readVector2UV (EasyXMLElement root)
 
Quaternion readVectorAsQuaternion (EasyXMLElement root)
 Read vector tag as quaternion. More...
 
void writeColor3 (EasyXMLElement root, String name, Color color)
 Write 3-component color tag using rgb attributes. More...
 
void writeColor4 (EasyXMLElement root, String name, Color color)
 Write 4-component color tag using rgba attributes. More...
 
void writeCurveBezier (EasyXMLElement root, String name, CurveBezier curve)
 Write bezier curve tag. More...
 
void writeCurveBezierPoint (EasyXMLElement root, String name, CurveBezier curve, int point)
 Write bezier curve point tag. More...
 
void writeDVector (EasyXMLElement root, String name, DVector vector)
 Write vector tag. More...
 
void writeFloatRectArea (EasyXMLElement root, String name, FloatRectArea rectArea)
 Write floatRectRea tag. More...
 
void writePoint (EasyXMLElement root, String name, Point point)
 Write point tag. More...
 
void writePoint3 (EasyXMLElement root, String name, Point3 point)
 Write point3 tag. More...
 
void writeRectArea (EasyXMLElement root, String name, RectArea rectArea)
 Write rectArea tag. More...
 
void writeVector (EasyXMLElement root, String name, Vector vector)
 Write vector tag. More...
 
void writeVector2 (EasyXMLElement root, String name, Vector2 vector)
 Write vector2 tag. More...
 

Public Attributes

Console pConsole
 
String pLogFilename
 
String pName
 

Protected Member Functions

Object loadAndParseRootTag (String filename, bool stripComments, bool cleanCharData, String rootTagName, Block parseBlock)
 Load file safely. More...
 
Object loadAndParseRootTag (String filename, String rootTagName, Block parseBlock)
 Load file safely. More...
 

Detailed Description

Basic xml loader class providing functionality useful across various xml file loaders. Stores also a name and a console so the error functions are more generic.

Member Function Documentation

◆ getConsole()

Console Dragengine.LoadSave.BaseXmlLoader.getConsole ( )

Retrieves the console.

◆ getName()

String Dragengine.LoadSave.BaseXmlLoader.getName ( )

Retrieves the name.

◆ hexToInt()

int Dragengine.LoadSave.BaseXmlLoader.hexToInt ( byte  hex)

Converts a hex value to an integer value.

◆ loadAndParseRootTag() [1/2]

Object Dragengine.LoadSave.BaseXmlLoader.loadAndParseRootTag ( String  filename,
bool  stripComments,
bool  cleanCharData,
String  rootTagName,
Block  parseBlock 
)
protected

Load file safely.

Loads file inside a try-catch block to report failures in a debuggable way. The file is loaded then checked if the root tag has the correct name. Then the block is called to parse the root tag. The block receives as only parameter the root tag of type EasyXMLElement. The return value of the block is returned.

◆ loadAndParseRootTag() [2/2]

Object Dragengine.LoadSave.BaseXmlLoader.loadAndParseRootTag ( String  filename,
String  rootTagName,
Block  parseBlock 
)
protected

Load file safely.

Loads file inside a try-catch block to report failures in a debuggable way. The file is loaded then checked if the root tag has the correct name. Then the block is called to parse the root tag. The block receives as only parameter the root tag of type EasyXMLElement. The return value of the block is returned.

◆ logDeprecated() [1/2]

void Dragengine.LoadSave.BaseXmlLoader.logDeprecated ( EasyXMLElement  tag,
String  whatIsDeprecated 
)

Outputs an deprecated message on the application console.

◆ logDeprecated() [2/2]

void Dragengine.LoadSave.BaseXmlLoader.logDeprecated ( EasyXMLElement  tag,
String  whatIsDeprecated,
String  useWhatInstead 
)

Outputs an deprecated message on the application console.

◆ logDeprecatedTag()

void Dragengine.LoadSave.BaseXmlLoader.logDeprecatedTag ( EasyXMLElement  tag)

Outputs an deprecated message on the application console.

◆ logDuplicateObject()

void Dragengine.LoadSave.BaseXmlLoader.logDuplicateObject ( EasyXMLElement  tag,
String  object,
String  identifier 
)

Output error message duplicate object on the application console.

◆ logIncompatibleAttributes()

void Dragengine.LoadSave.BaseXmlLoader.logIncompatibleAttributes ( EasyXMLElement  tag,
String  attributeNames 
)

Outputs error message about incompatible attributes.

◆ logInvalidAttribute()

void Dragengine.LoadSave.BaseXmlLoader.logInvalidAttribute ( String  filename,
EasyXMLElement  tag,
String  attribute 
)

Log attribute not allowed.

◆ logInvalidAttributeValue()

void Dragengine.LoadSave.BaseXmlLoader.logInvalidAttributeValue ( EasyXMLElement  tag,
String  attribute,
String  value 
)

Outputs error message invalid attribute value on the application console.

◆ logInvalidEmptyString()

void Dragengine.LoadSave.BaseXmlLoader.logInvalidEmptyString ( EasyXMLElement  tag)

Outputs error message invalid empty string on the application console.

◆ logInvalidValue() [1/2]

void Dragengine.LoadSave.BaseXmlLoader.logInvalidValue ( EasyXMLElement  tag,
String  value 
)

Outputs error message invalid value on the application console.

◆ logInvalidValue() [2/2]

void Dragengine.LoadSave.BaseXmlLoader.logInvalidValue ( String  filename,
EasyXMLElement  tag,
String  value 
)

Outputs error message invalid value on the application console.

◆ logLoadFileFailed()

void Dragengine.LoadSave.BaseXmlLoader.logLoadFileFailed ( EasyXMLElement  tag,
String  filename 
)

Outputs error message about a failure to load another file or resource.

◆ logLoadingFailed()

void Dragengine.LoadSave.BaseXmlLoader.logLoadingFailed ( String  filename)

Log loading file failed with error log.

◆ logLoadingFromFile()

void Dragengine.LoadSave.BaseXmlLoader.logLoadingFromFile ( String  filename)

Log filename on the application console.

◆ logMissingAttribute()

void Dragengine.LoadSave.BaseXmlLoader.logMissingAttribute ( EasyXMLElement  tag,
String  attrName 
)

Outputs error message missing attribute on the application console.

◆ logMissingCData()

void Dragengine.LoadSave.BaseXmlLoader.logMissingCData ( EasyXMLElement  tag)

Outputs error message missing attribute on the application console.

◆ logMissingTag()

void Dragengine.LoadSave.BaseXmlLoader.logMissingTag ( String  tagName)

Outputs error message missing tag on the application console.

◆ logNotSupported()

void Dragengine.LoadSave.BaseXmlLoader.logNotSupported ( EasyXMLElement  tag,
String  whatIsNotSupported 
)

Outputs error message about a feature not being supported.

◆ logObjectExists()

void Dragengine.LoadSave.BaseXmlLoader.logObjectExists ( EasyXMLElement  tag,
String  object,
String  value 
)

Output error message value exists already on the application console.

◆ logParsingFailed()

void Dragengine.LoadSave.BaseXmlLoader.logParsingFailed ( String  errorLog)

Log parsing failed with error log.

◆ logSavingFailed()

void Dragengine.LoadSave.BaseXmlLoader.logSavingFailed ( String  filename)

Log saving to file failed with error log.

◆ logSavingFromFile()

void Dragengine.LoadSave.BaseXmlLoader.logSavingFromFile ( String  filename)

Log filename on the application console.

◆ logUnknownTag() [1/2]

void Dragengine.LoadSave.BaseXmlLoader.logUnknownTag ( EasyXMLElement  tag)

Outputs error message invalid axis on the application console.

◆ logUnknownTag() [2/2]

void Dragengine.LoadSave.BaseXmlLoader.logUnknownTag ( String  filename,
EasyXMLElement  tag 
)

Outputs error message invalid axis on the application console.

◆ new()

◆ printOnConsole() [1/4]

void Dragengine.LoadSave.BaseXmlLoader.printOnConsole ( EasyXMLElement  tag,
String  errorMessage 
)

Outputs an error message on the application console.

◆ printOnConsole() [2/4]

void Dragengine.LoadSave.BaseXmlLoader.printOnConsole ( String  filename,
EasyXMLElement  tag,
String  message 
)

Print message on console.

◆ printOnConsole() [3/4]

void Dragengine.LoadSave.BaseXmlLoader.printOnConsole ( String  filename,
String  message 
)

Print message on console.

◆ printOnConsole() [4/4]

void Dragengine.LoadSave.BaseXmlLoader.printOnConsole ( String  message)

Outputs an error message on the application console.

◆ readBorderSize()

BorderSize Dragengine.LoadSave.BaseXmlLoader.readBorderSize ( EasyXMLElement  root)

Read border size area.

◆ readCDataHex()

int Dragengine.LoadSave.BaseXmlLoader.readCDataHex ( EasyXMLElement  tag)

Read CData as int where the value is stored hexadecial. If no CData is specified 0 is returned. The hexadecimal value is specified as a one or two character value. The characters have to be in the range from 0 to 9, a to f or A to F. No prefix is used. If more than two characters are specified only the first two are used.

◆ readColor() [1/2]

Color Dragengine.LoadSave.BaseXmlLoader.readColor ( EasyXMLElement  root)

Read color tag. The color components are defined using one or more child tags. One group of tags is red, green, blue and alpha to specify the color components in the range from 0 to 1. Another group of tags is intRed, intGreen, intBlue and intAlpha to specify the color components in the range from 0 to 255 where 0 equals to 0 intensity and 255 equals to full intensity. A third group of tags is hexRed, hexGreen, hexBlue and hexAlpha to specify the color components using a 1 or 2 digit hexadecimal number. The hexadecimal number can contain upper or lower case alphabetic characters. No prefix is required. If a component is not specified the default value is used which is 0 for red, green and blue and 1 for alpha.

◆ readColor() [2/2]

Color Dragengine.LoadSave.BaseXmlLoader.readColor ( EasyXMLElement  root,
Color  defaultColor 
)

Read color tag. The color components are defined using one or more child tags. One group of tags is red, green, blue and alpha to specify the color components in the range from 0 to 1. Another group of tags is intRed, intGreen, intBlue and intAlpha to specify the color components in the range from 0 to 255 where 0 equals to 0 intensity and 255 equals to full intensity. A third group of tags is hexRed, hexGreen, hexBlue and hexAlpha to specify the color components using a 1 or 2 digit hexadecimal number. The hexadecimal number can contain upper or lower case alphabetic characters. No prefix is required. If a component is not specified the default value is used which is 0 for red, green and blue and 1 for alpha.

◆ readColorMatrix()

ColorMatrix Dragengine.LoadSave.BaseXmlLoader.readColorMatrix ( EasyXMLElement  root)

Read color matrix.

◆ readCurveBezier()

CurveBezier Dragengine.LoadSave.BaseXmlLoader.readCurveBezier ( EasyXMLElement  root)

Read curve tag.

◆ readCurveBezierPoint()

void Dragengine.LoadSave.BaseXmlLoader.readCurveBezierPoint ( EasyXMLElement  root,
CurveBezier  curve 
)

Read curve point tag.

◆ readDVector()

DVector Dragengine.LoadSave.BaseXmlLoader.readDVector ( EasyXMLElement  root)

Read double vector tag.

◆ readFloatRectArea()

FloatRectArea Dragengine.LoadSave.BaseXmlLoader.readFloatRectArea ( EasyXMLElement  root)

Read floating point rectangular area.

◆ readFont() [1/2]

Font Dragengine.LoadSave.BaseXmlLoader.readFont ( EasyXMLElement  root)

Parse font tag.

The font properties are defined using child tags. The file tag defines the font file to use while the size tag defines the size of the font object. The size is given as the height of the font in pixels. Both tags are required. If one or both are missing a null font object is returned.

◆ readFont() [2/2]

Font Dragengine.LoadSave.BaseXmlLoader.readFont ( EasyXMLElement  root,
String  basePath 
)

Parse font tag.

The font properties are defined using child tags. The file tag defines the font file to use while the size tag defines the size of the font object. The size is given as the height of the font in pixels. Both tags are required. If one or both are missing a null font object is returned.

◆ readMultilineString()

String Dragengine.LoadSave.BaseXmlLoader.readMultilineString ( EasyXMLElement  root)

Multi-line string or an empty string if absent.

Multi-line strings support br-tags to add line-breaks. Parsing stops if no more CDATA are present or a non-br tag is encountered.

◆ readPoint()

Point Dragengine.LoadSave.BaseXmlLoader.readPoint ( EasyXMLElement  root)

Read point tag.

◆ readPoint3()

Point3 Dragengine.LoadSave.BaseXmlLoader.readPoint3 ( EasyXMLElement  root)

Read 3-component point tag.

◆ readRectArea()

RectArea Dragengine.LoadSave.BaseXmlLoader.readRectArea ( EasyXMLElement  root)

Read rectangular area.

◆ readVector()

Vector Dragengine.LoadSave.BaseXmlLoader.readVector ( EasyXMLElement  root)

Read vector tag.

◆ readVector2()

Vector2 Dragengine.LoadSave.BaseXmlLoader.readVector2 ( EasyXMLElement  root)

Read vector2 tag.

◆ readVector2UV()

Vector2 Dragengine.LoadSave.BaseXmlLoader.readVector2UV ( EasyXMLElement  root)

Read vector2 tag using the uv instead of xy notation.

◆ readVectorAsQuaternion()

Quaternion Dragengine.LoadSave.BaseXmlLoader.readVectorAsQuaternion ( EasyXMLElement  root)

Read vector tag as quaternion.

◆ writeColor3()

void Dragengine.LoadSave.BaseXmlLoader.writeColor3 ( EasyXMLElement  root,
String  name,
Color  color 
)

Write 3-component color tag using rgb attributes.

Version
1.6

◆ writeColor4()

void Dragengine.LoadSave.BaseXmlLoader.writeColor4 ( EasyXMLElement  root,
String  name,
Color  color 
)

Write 4-component color tag using rgba attributes.

Version
1.6

◆ writeCurveBezier()

void Dragengine.LoadSave.BaseXmlLoader.writeCurveBezier ( EasyXMLElement  root,
String  name,
CurveBezier  curve 
)

Write bezier curve tag.

Version
1.9

◆ writeCurveBezierPoint()

void Dragengine.LoadSave.BaseXmlLoader.writeCurveBezierPoint ( EasyXMLElement  root,
String  name,
CurveBezier  curve,
int  point 
)

Write bezier curve point tag.

Version
1.9

◆ writeDVector()

void Dragengine.LoadSave.BaseXmlLoader.writeDVector ( EasyXMLElement  root,
String  name,
DVector  vector 
)

Write vector tag.

Version
1.6
Note
This will loose prevision due to converting to float.

◆ writeFloatRectArea()

void Dragengine.LoadSave.BaseXmlLoader.writeFloatRectArea ( EasyXMLElement  root,
String  name,
FloatRectArea  rectArea 
)

Write floatRectRea tag.

Version
1.22

◆ writePoint()

void Dragengine.LoadSave.BaseXmlLoader.writePoint ( EasyXMLElement  root,
String  name,
Point  point 
)

Write point tag.

Version
1.6

◆ writePoint3()

void Dragengine.LoadSave.BaseXmlLoader.writePoint3 ( EasyXMLElement  root,
String  name,
Point3  point 
)

Write point3 tag.

Version
1.6

◆ writeRectArea()

void Dragengine.LoadSave.BaseXmlLoader.writeRectArea ( EasyXMLElement  root,
String  name,
RectArea  rectArea 
)

Write rectArea tag.

Version
1.22

◆ writeVector()

void Dragengine.LoadSave.BaseXmlLoader.writeVector ( EasyXMLElement  root,
String  name,
Vector  vector 
)

Write vector tag.

Version
1.6

◆ writeVector2()

void Dragengine.LoadSave.BaseXmlLoader.writeVector2 ( EasyXMLElement  root,
String  name,
Vector2  vector 
)

Write vector2 tag.

Version
1.6

Member Data Documentation

◆ pConsole

Console Dragengine.LoadSave.BaseXmlLoader.pConsole

◆ pLogFilename

String Dragengine.LoadSave.BaseXmlLoader.pLogFilename

◆ pName

String Dragengine.LoadSave.BaseXmlLoader.pName

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