#pragma once #include #include #include #include #include #include namespace hex::plugin::builtin { class ProviderExtraData { public: struct Data { bool dataDirty = false; struct { std::string sourceCode; std::unique_ptr runtime; } patternLanguage; std::list bookmarks; struct { std::list endNodes; std::list> nodes; std::list links; std::vector dataOverlays; std::optional currNodeError; } dataProcessor; }; static Data& getCurrent() { return get(ImHexApi::Provider::get()); } static Data& get(hex::prv::Provider *provider) { return s_data[provider]; } static void erase(hex::prv::Provider *provider) { s_data.erase(provider); } static bool markDirty() { return getCurrent().dataDirty = true; } private: ProviderExtraData() = default; static inline std::map s_data = {}; }; }