A converter.

If you want to use it globally, you can use nb.fs.ConverterManager.

Available since

0.1.0

.

Constructor

@:value({ priority : 0 })new(fromType:Array<String>, toType:Array<String>, f:(Bytes, Array<String>) ‑> Bytes, ?keywords:Array<String>, priority:Int = 0)

Creates a new nb.fs.Converter instance.

Parameters:

fromType

Type to convert from.

toType

Type to convert to.

f

The function that does the conversion. Has the bytes to be converted then keywords as arguments.

keywords

Strings used as parameters when doing conversion.

priority

It's priority level. Default is 0.

Variables

fromType:Array<String>

Types that can be converted from. Setting "*" at index 0 means it can deal with any type.

keywords:Array<String>

Strings used as parameters when doing conversion.

priority:Int

It's priority level. Default is 0.

toType:Array<String>

Types that can be converted to.

f:(Bytes, Array<String>) ‑> Bytes

The function that does the conversion. Has the bytes to be converted then keywords as arguments.

Methods

convert(bytes:Bytes):Bytes

Converts data without defining its type nor the resulting type.