FivePD API
Interfaces/Addons

IAddonFileHandlerService

Provides utility methods for file handling within addons.

Methods

LoadFile

Loads the content of the given file within the current addon.

Parameters

NameTypeDescription
pathstringThe path of the file. Should match with any of the specified items in the "Files" property of the addon metadata file.

Returns

NameType
stringThe string content of the file.

LoadFile

!! IT CAN ONLY DESERIALIZE FROM JSON AND YAML !! Reads the given file within the current addon. If empty, returns T with its default values. Otherwise returns the data deserialized to the given type. Note that the deserialized data will be cached. Type upon retrieval must match the type used when first deserializing.

Parameters

NameTypeDescription
pathstringThe path of the file. Should match with any of the specified items in the "Files" property of the addon metadata file.

Returns

NameType
TThe data converted to T.