Base class for all specialized decoders.
Programmers must extend this class for any specific asset file formats. All decoders must be registered through the CYIAssetLoader interface, if they want to be used by the You.i Engine framework.
#include <asset/YiAssetDecoder.h>

Public Member Functions | |
| CYIAssetDecoder (const CYIRuntimeTypeInfo &assetType) | |
| virtual | ~CYIAssetDecoder () |
| virtual bool | IsExtensionSupported (const CYIString &extension) |
| virtual bool | IsFormatSupported (const uint8_t *pData, uint32_t nDataSize)=0 |
| virtual bool | SupportsParams (const CYIAssetLoadParams *pDecodeParams) |
| virtual bool | SupportsType (const CYIRuntimeTypeInfo &assetType) |
| virtual std::shared_ptr< CYIAsset > | DecodeAsset (const CYIString &path, const CYIAssetLoadParams *pDecodeParams=nullptr)=0 |
| virtual std::shared_ptr< CYIAsset > | DecodeAsset (const uint8_t *pData, uint32_t nDataSize, const CYIAssetLoadParams *pDecodeParams=nullptr)=0 |
| virtual bool | DecodeAsset (const std::shared_ptr< CYIAsset > &pAsset)=0 |
| virtual bool | DecodeAsset (const std::shared_ptr< CYIAsset > &pAsset, const uint8_t *pData, uint32_t uDataSize)=0 |
| CYIString | GetExtension () const |
| const std::vector< CYIString > & | GetExtensions () const |
Protected Attributes | |
| std::vector< CYIString > | m_SupportedExtensions |
| const CYIRuntimeTypeInfo & | m_AssetType |
| CYIAssetDecoder::CYIAssetDecoder | ( | const CYIRuntimeTypeInfo & | assetType | ) |
|
virtual |
|
pure virtual |
Decode an asset at the specified path using the optional decoding parameters pDecodeParams. The pDecodeParams can be nullptr.
Implemented in CYIAssetDecoderJSON, CYIAssetDecoderScript, CYIAssetDecoderTemplate, CYIAssetDecoderTimelineSource, CYIAssetDecoderTranslation, CYIAssetDecoderImage, CYIAssetDecoderBif, CYIAssetDecoderVideo, CYIAssetDecoderShaderObject, and CYIAssetDecoderWAV.
|
pure virtual |
Decode an asset using pre-loaded file data pData, nDataSize, and the optional decoding parameters pDecodeParams. The pDecodeParams can be nullptr.
Implemented in CYIAssetDecoderJSON, CYIAssetDecoderScript, CYIAssetDecoderTemplate, CYIAssetDecoderTimelineSource, CYIAssetDecoderTranslation, CYIAssetDecoderImage, CYIAssetDecoderBif, CYIAssetDecoderShaderObject, CYIAssetDecoderVideo, and CYIAssetDecoderWAV.
|
pure virtual |
Decode an asset using an existing asset instance. The path must be set through CYIAsset::SetPath, and the optional decoding parameters may be set through CYIAsset::SetLoadParameters. Returns true if the decoding was successful, false otherwise.
Implemented in CYIAssetDecoderJSON, CYIAssetDecoderScript, CYIAssetDecoderTemplate, CYIAssetDecoderTimelineSource, CYIAssetDecoderTranslation, CYIAssetDecoderImage, CYIAssetDecoderBif, CYIAssetDecoderShaderObject, CYIAssetDecoderVideo, and CYIAssetDecoderWAV.
|
pure virtual |
Decode an asset using an existing asset instance, and pre-loaded file data pData and uDataSize. The optional decoding parameters may be set through CYIAsset::SetLoadParameters. Returns true if the decoding was successful, false otherwise.
Implemented in CYIAssetDecoderTemplate, CYIAssetDecoderTimelineSource, CYIAssetDecoderJSON, CYIAssetDecoderScript, CYIAssetDecoderImage, CYIAssetDecoderTranslation, CYIAssetDecoderBif, CYIAssetDecoderShaderObject, CYIAssetDecoderWAV, and CYIAssetDecoderVideo.
| CYIString CYIAssetDecoder::GetExtension | ( | ) | const |
Return the first extension supported by the decoder, or an empty string if no extension is available.
| const std::vector<CYIString>& CYIAssetDecoder::GetExtensions | ( | ) | const |
Returns all extensions supported by the decoder.
|
virtual |
Returns true if the supplied extension is supported by this decoder. For consistency, supported extensions should be supplied by the decoder in lower case and no leading '.' characters. File names with multiple extensions should be specificed like "a.b".
|
pure virtual |
Returns true if the file format is supported. The file contents are supplied through pData and the size of the buffer must be given through nDataSize.
Implemented in CYIAssetDecoderTemplate, CYIAssetDecoderTimelineSource, CYIAssetDecoderBif, CYIAssetDecoderJSON, CYIAssetDecoderScript, CYIAssetDecoderShaderObject, CYIAssetDecoderVideo, CYIAssetDecoderWAV, CYIAssetDecoderTranslation, and CYIAssetDecoderImage.
|
virtual |
Returns true if the decoder supports a specialized parameter type.
Reimplemented in CYIAssetDecoderJSON, CYIAssetDecoderScript, CYIAssetDecoderTemplate, CYIAssetDecoderTimelineSource, CYIAssetDecoderTranslation, CYIAssetDecoderVideo, CYIAssetDecoderBif, CYIAssetDecoderImage, CYIAssetDecoderShaderObject, and CYIAssetDecoderWAV.
|
virtual |
Returns true if the decoder supports a specialized asset type.
|
protected |
|
protected |