MCPcopy Create free account
hub / github.com/OpenRCT2/OpenRCT2 / FileSystemDataRetriever

Class FileSystemDataRetriever

src/openrct2/object/ObjectFactory.cpp:67–96  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers 1

CreateObjectFromJsonFileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected