MCPcopy Create free account
hub / github.com/GlobedGD/globed2 / isEmbeddedScript

Function isEmbeddedScript

src/modules/scripting/data/EmbeddedScript.cpp:13–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11static constexpr std::array EMBEDDED_SCRIPT_MAGIC = {'\xc4', '\x19', '\x7b', '\xfa'};
12
13static bool isEmbeddedScript(const gd::string& str) {
14 if (str.size() < EMBEDDED_SCRIPT_MAGIC.size()) {
15 return false;
16 }
17
18 for (size_t i = 0; i < EMBEDDED_SCRIPT_MAGIC.size(); i++) {
19 if (EMBEDDED_SCRIPT_MAGIC[i] != str[i]) return false;
20 }
21
22 return true;
23}
24
25#define MAP_UNWRAP(x) GEODE_UNWRAP((x).mapErr([](const auto& e) { return e.message(); }))
26

Callers

nothing calls this directly

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected