#include #include #include #include #include #include namespace hex::plugin::builtin { void registerPatternLanguageFunctions() { using namespace pl::core; using FunctionParameterCount = pl::api::FunctionParameterCount; pl::api::Namespace nsStdHttp = { "builtin", "std", "http" }; { /* get(url) */ ContentRegistry::PatternLanguage::addDangerousFunction(nsStdHttp, "get", FunctionParameterCount::exactly(1), [](Evaluator *, auto params) -> std::optional { const auto url = Token::literalToString(params[0], false); hex::Net net; return net.getString(url).get().body; }); } } }