#ifndef __FISHBONE_RESOURCE_H__ #define __FISHBONE_RESOURCE_H__ #include namespace fishbone { class Resource; class BaseEngine; }; // namespace fishbone #include namespace fishbone { class ResourceResolver { public: virtual bool exists(std::string path) = 0; virtual size_t getSize(std::string path) = 0; virtual bool copyData(std::string path, char* buffer, size_t maxSize) = 0; }; class DirectoryResourceResolver : public ResourceResolver { std::vector searchPaths; std::string findAbsolutePath(std::string path); public: DirectoryResourceResolver(std::vector searchPaths); bool exists(std::string path) override; size_t getSize(std::string path) override; bool copyData(std::string path, char* buffer, size_t maxSize) override; }; class Resource { char* buffer; size_t bufferSize; public: fishbone::File* open(std::string path); Resource(BaseEngine* engine, std::string path); ~Resource(); char* getBuffer(); size_t getSize(); }; }; // namespace fishbone #endif