nsIFormatConverter

Methods

getInputDataFlavors()

Get the list of the “input” data flavors (mime types as nsISupportsCString),
in otherwords, the flavors that this converter can convert “from” (the
incoming data to the converter).

getOutputDataFlavors()

Get the list of the “output” data flavors (mime types as nsISupportsCString),
in otherwords, the flavors that this converter can convert “to” (the
outgoing data to the converter).

Parameters

aDataFlavorList fills list with supported flavors

canConvert(aFromDataFlavor, aToDataFlavor)

Determines whether a conversion from one flavor to another is supported

Parameters

aFromFormatConverter flavor to convert from
aFromFormatConverter flavor to convert to

convert(aFromDataFlavor, aFromData, aDataLen, aToDataFlavor, aToData, aDataToLen)

Converts from one flavor to another.

Parameters

aFromFormatConverter flavor to convert from
aFromFormatConverter flavor to convert to (destination own the memory)

Returns

returns NS_OK if it was converted