ImgLoaderEnum.h 573 B

123456789101112131415161718192021222324
  1. #ifndef __WASABI_IMGLOADERENUM_H
  2. #define __WASABI_IMGLOADERENUM_H
  3. #include <api/service/svc_enum.h>
  4. #include <bfc/string/StringW.h>
  5. class ImgLoaderEnum : public SvcEnumT<svc_imageLoader> {
  6. public:
  7. ImgLoaderEnum(uint8_t *data, int datalen) : mem(datalen, data) { }
  8. ImgLoaderEnum(const wchar_t *filename) : fname(filename) { }
  9. protected:
  10. virtual int testService(svc_imageLoader *svc)
  11. {
  12. if (!fname.isempty() && !svc->isMine(fname)) return 0;
  13. return svc->testData(mem, mem.getSizeInBytes());
  14. }
  15. private:
  16. StringW fname;
  17. MemBlock<uint8_t> mem;
  18. };
  19. #endif