| 65 | }; |
| 66 | |
| 67 | class FileSystemDataRetriever : public IFileDataRetriever |
| 68 | { |
| 69 | private: |
| 70 | std::string _basePath; |
| 71 | |
| 72 | public: |
| 73 | FileSystemDataRetriever(std::string_view basePath) |
| 74 | : _basePath(basePath) |
| 75 | { |
| 76 | } |
| 77 | |
| 78 | std::vector<uint8_t> GetData(std::string_view path) const override |
| 79 | { |
| 80 | auto absolutePath = Path::Combine(_basePath, path); |
| 81 | return File::ReadAllBytes(absolutePath); |
| 82 | } |
| 83 | |
| 84 | ObjectAsset GetAsset(std::string_view path) const override |
| 85 | { |
| 86 | if (Path::IsAbsolute(path)) |
| 87 | { |
| 88 | return ObjectAsset(path); |
| 89 | } |
| 90 | else |
| 91 | { |
| 92 | auto absolutePath = Path::Combine(_basePath, path); |
| 93 | return ObjectAsset(absolutePath); |
| 94 | } |
| 95 | } |
| 96 | }; |
| 97 | |
| 98 | class ZipDataRetriever : public IFileDataRetriever |
| 99 | { |
no outgoing calls
no test coverage detected