MCPcopy Create free account
hub / github.com/EasyRPG/Player / Detect

Method Detect

src/filesystem_hook.cpp:73–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71}
72
73FilesystemView HookFilesystem::Detect(FilesystemView fs) {
74 auto lmt = fs.OpenInputStream(TREEMAP_NAME);
75 if (lmt) {
76 std::array<char, 11> buf;
77
78 lmt.ReadIntoObj(buf);
79
80 if (!memcmp(buf.data(), "\xbMdgNbqUsff", 11)) {
81 auto hook_fs = std::make_shared<HookFilesystem>(fs, Hook::SacredTears);
82 return hook_fs->Subtree("");
83 }
84 }
85
86 return fs;
87}
88
89bool HookFilesystem::IsFile(std::string_view path) const {
90 return GetParent().IsFile(path);

Callers

nothing calls this directly

Calls 4

OpenInputStreamMethod · 0.80
ReadIntoObjMethod · 0.80
dataMethod · 0.80
SubtreeMethod · 0.80

Tested by

no test coverage detected