Helpers.hx

Miscallenous helper functions collected into a class.

Summary
Helpers.hxMiscallenous helper functions collected into a class.
XmlNNTuple for xml namespace and local name
Variables
nsNamespace
lnLocal name
HelpersHelper class with static functions used across the entire application.
text helper methods
expandTabsReplaces all tabs with 3 spaces.
tabbedAdds three spaces to the beginning of each line of the parameter string.
onelinedRemoves newlines from the string.
Namespaced Xml helper methods
getXmlNNReturns the namespace and localname of an Xml.Element
elementsLocalNamedReturns all elements with the given localname.
elementsNamespacedReturns all elements in a given namespace
Import modules helper methods
generateClassGenerates a class definition with the given superclass.
getIdForHashSymbolCheckReturns a character ID for the given data hash and tag type and checks the availability of the given symbol class.
Version string related functions
stripBugfixVersionRemoves the bugfix version from version string if present.

XmlNN

Tuple for xml namespace and local name

Summary
Variables
nsNamespace
lnLocal name

Variables

ns

ns : String

Namespace

ln

ln : String

Local name

Helpers

Helper class with static functions used across the entire application.

Summary
text helper methods
expandTabsReplaces all tabs with 3 spaces.
tabbedAdds three spaces to the beginning of each line of the parameter string.
onelinedRemoves newlines from the string.
Namespaced Xml helper methods
getXmlNNReturns the namespace and localname of an Xml.Element
elementsLocalNamedReturns all elements with the given localname.
elementsNamespacedReturns all elements in a given namespace
Import modules helper methods
generateClassGenerates a class definition with the given superclass.
getIdForHashSymbolCheckReturns a character ID for the given data hash and tag type and checks the availability of the given symbol class.
Version string related functions
stripBugfixVersionRemoves the bugfix version from version string if present.

text helper methods

expandTabs

Replaces all tabs with 3 spaces.

Parameters

sthe string to alter

Returns

The altered string

tabbed

public static function tabbed(String) : String

Adds three spaces to the beginning of each line of the parameter string.

Parameters

sthe string to pad

Returns

The padded string

onelined

inline public static function onelined(String) : String

Removes newlines from the string.

Parameters

sthe string to be transformed

Returns

The cleaned string

Namespaced Xml helper methods

getXmlNN

public static function getXmlNN(Xml) : XmlNN

Returns the namespace and localname of an Xml.Element

Parameters

xthe Xml element

Returns

The corresponding XmlNN tuple

elementsLocalNamed

public static function elementsLocalNamed(Xml,
lname String)

Returns all elements with the given localname.

Parameters

lnamethe local name

Returns

The requested elements.

elementsNamespaced

public static function elementsNamespaced(Xml,
ns String)

Returns all elements in a given namespace

Parameters

nsthe namespace

Returns

The requested elements.

Import modules helper methods

generateClass

public static function generateClass(as3Reg: AS3Registry,
className: String,
superClassName: String)

Generates a class definition with the given superclass.

Parameters

as3Regthe AS3 registry instance
classNamethe class name to generate
superClassNamethe name of the superclass to derive from

getIdForHashSymbolCheck

public static function getIdForHashSymbolCheck(
   md5: String,
   tagId: Int,
   idReg: IdRegistry,
   ?symbolReg: SymbolRegistry,
   ?symbol: String
): HashIdSymCheckResult

Returns a character ID for the given data hash and tag type and checks the availability of the given symbol class.

Parameters

md5the MD5 sum of the asset
tagIdthe SWF tag ID
idRegthe IdRegistry instance
symbolRegthe SymbolRegistry instance
symbolthe AS3 class name

Returns

The character ID, wrapped in HashIdSymCheckResult.

Version string related functions

stripBugfixVersion

public static function stripBugfixVersion(version: String): String

Removes the bugfix version from version string if present.

Parameters

versionthe version string

Returns

The stripped version string.

ns : String
Namespace
ln : String
Local name
public static function tabbed(String) : String
Adds three spaces to the beginning of each line of the parameter string.
inline public static function onelined(String) : String
Removes newlines from the string.
public static function getXmlNN(Xml) : XmlNN
Returns the namespace and localname of an Xml.Element
public static function elementsLocalNamed(Xml,
lname String)
Returns all elements with the given localname.
public static function elementsNamespaced(Xml,
ns String)
Returns all elements in a given namespace
public static function generateClass(as3Reg: AS3Registry,
className: String,
superClassName: String)
Generates a class definition with the given superclass.
public static function getIdForHashSymbolCheck(
   md5: String,
   tagId: Int,
   idReg: IdRegistry,
   ?symbolReg: SymbolRegistry,
   ?symbol: String
): HashIdSymCheckResult
Returns a character ID for the given data hash and tag type and checks the availability of the given symbol class.
public static function stripBugfixVersion(version: String): String
Removes the bugfix version from version string if present.
Tuple for xml namespace and local name
Close