You.i Engine
YiAssetDecoder.h
Go to the documentation of this file.
1 // © You i Labs Inc. 2000-2017. All rights reserved.
2 #ifndef _YI_ASSET_DECODER_H_
3 #define _YI_ASSET_DECODER_H_
4 
5 #include "asset/YiAsset.h"
6 #include "framework/YiPredef.h"
7 #include "utility/YiString.h"
8 
10 
23 {
24 public:
25  CYIAssetDecoder(const CYIRuntimeTypeInfo &assetType);
26  virtual ~CYIAssetDecoder();
27 
34  virtual bool IsExtensionSupported(const CYIString &extension);
35 
40  virtual bool IsFormatSupported(const uint8_t *pData, uint32_t nDataSize) = 0;
41 
45  virtual bool SupportsParams(const CYIAssetLoadParams *pDecodeParams);
46 
50  virtual bool SupportsType(const CYIRuntimeTypeInfo &assetType);
51 
56  virtual std::shared_ptr<CYIAsset> DecodeAsset(const CYIString &path, const CYIAssetLoadParams *pDecodeParams = nullptr) = 0;
57 
62  virtual std::shared_ptr<CYIAsset> DecodeAsset(const uint8_t *pData, uint32_t nDataSize, const CYIAssetLoadParams *pDecodeParams = nullptr) = 0;
63 
69  virtual bool DecodeAsset(const std::shared_ptr<CYIAsset> &pAsset) = 0;
70 
75  virtual bool DecodeAsset(const std::shared_ptr<CYIAsset> &pAsset, const uint8_t *pData, uint32_t uDataSize) = 0;
76 
80  CYIString GetExtension() const;
81 
85  const std::vector<CYIString> &GetExtensions() const;
86 
87 protected:
88  std::vector<CYIString> m_SupportedExtensions;
89 
91 
93 
94 private:
96 };
97 
100 #endif // _YI_ASSET_DECODER_H_
CYIString GetExtension() const
#define YI_DISALLOW_COPY_AND_ASSIGN(TypeName)
Delete the copy constructor and assignment operator (and consequently the move constructor as well) ...
Definition: YiPredef.h:114
Container class for Unicode strings. Conceptually, a CYIString object is a sequence of Unicode charac...
Definition: YiString.h:35
virtual bool SupportsParams(const CYIAssetLoadParams *pDecodeParams)
#define YI_TYPE_BASES(...)
Definition: YiRtti.h:350
CYIAssetDecoder(const CYIRuntimeTypeInfo &assetType)
virtual std::shared_ptr< CYIAsset > DecodeAsset(const CYIString &path, const CYIAssetLoadParams *pDecodeParams=nullptr)=0
virtual bool IsExtensionSupported(const CYIString &extension)
const std::vector< CYIString > & GetExtensions() const
Base class for decoders which can accept specialized parameter objects.
Definition: YiAssetLoadParams.h:16
const CYIRuntimeTypeInfo & m_AssetType
Definition: YiAssetDecoder.h:90
virtual bool SupportsType(const CYIRuntimeTypeInfo &assetType)
The abstract runtime representation of a C++ type.
Definition: YiRtti.h:48
std::vector< CYIString > m_SupportedExtensions
Definition: YiAssetDecoder.h:88
virtual bool IsFormatSupported(const uint8_t *pData, uint32_t nDataSize)=0
Base class for all specialized decoders.
Definition: YiAssetDecoder.h:22
virtual ~CYIAssetDecoder()