Utility class to keep track of nb.fs.Converters.

Add converters to this class for them to be available globally via this class's converters. You can do this in MacroInit.hx for them to be available in macro context.

Available since

0.1.0

.

Static variables

@:value([])staticconverters:Array<Converter> = []

Contains all stored converters. They are used by this class's convert functions when needed.

Static methods

staticaddConverter(c:Converter):Converter

Stores a converter in this class.

staticconvert(bytes:Bytes, fromType:String, toType:String, ?keywords:Array<String>):Bytes

Converts data with a stored converter.

Throws an exception if no converter was found.

Parameters:

bytes

The data to convert as bytes.

fromType

bytes' type.

toType

The type to convert bytes to.

keywords

If not null, the converter should have at least one of these keywords.

Returns:

bytes converted.

staticgetConverters(fromType:String, ?toType:String, ?keywords:Array<String>):Array<Converter>

Gets all converters from this class that can be used to do a given conversion.

Parameters:

fromType

The converters should be able to convert from this type.

toType

The converters should be able to convert to this type.

keywords

If not null, the converters should have at least one of these keywords.

Returns:

An array of converters that satisfies all the aforementioned conditions.