| 1 | #ifndef SEAD_DECOMPRESSOR_H_ |
|---|---|
| 2 | #define SEAD_DECOMPRESSOR_H_ |
| 3 | |
| 4 | #include <basis/seadTypes.h> |
| 5 | #include <container/seadTList.h> |
| 6 | #include <heap/seadDisposer.h> |
| 7 | #include <prim/seadSafeString.h> |
| 8 | #include <resource/seadResource.h> |
| 9 | #include <resource/seadResourceMgr.h> |
| 10 | |
| 11 | namespace sead |
| 12 | { |
| 13 | class Decompressor : public TListNode<Decompressor*>, public IDisposer |
| 14 | { |
| 15 | public: |
| 16 | Decompressor(const SafeString& name) : TListNode<Decompressor*>(this), IDisposer(), mExt(name) |
| 17 | { |
| 18 | } |
| 19 | |
| 20 | virtual ~Decompressor() |
| 21 | { |
| 22 | if (ResourceMgr::instance() != NULL) |
| 23 | ResourceMgr::instance()->unregisterDecompressor(decompressor: this); |
| 24 | } |
| 25 | |
| 26 | virtual u8* tryDecompFromDevice(const ResourceMgr::LoadArg& loadArg, Resource* resource, |
| 27 | u32* outSize, u32* outAllocSize, bool* outAllocated) = 0; |
| 28 | |
| 29 | const SafeString& getName() const { return mExt; } |
| 30 | void setName(const SafeString& name) { mExt = name; } |
| 31 | |
| 32 | protected: |
| 33 | FixedSafeString<32> mExt; |
| 34 | }; |
| 35 | |
| 36 | } // namespace sead |
| 37 | |
| 38 | #endif // SEAD_DECOMPRESSOR_H_ |
| 39 |