mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-03 05:57:40 -05:00
patterns: Huge refactor of Pattern Language runtime to use smart pointers (#458)
* patterns: Initial work to refactor pattern language to use smart pointers * patterns: Fixed remaining issues, moved patterns to unique files * sys: Added missing includes for macOS
This commit is contained in:
@@ -59,7 +59,7 @@ namespace hex::plugin::builtin {
|
||||
u64 m_resizeSize = 0;
|
||||
|
||||
std::vector<u8> m_dataToSave;
|
||||
std::set<pl::PatternData *> m_highlightedPatterns;
|
||||
std::set<pl::Pattern *> m_highlightedPatterns;
|
||||
|
||||
std::string m_loaderScriptScriptPath;
|
||||
std::string m_loaderScriptFilePath;
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace hex::plugin::builtin {
|
||||
void drawContent() override;
|
||||
|
||||
private:
|
||||
std::map<prv::Provider *, std::vector<pl::PatternData *>> m_sortedPatterns;
|
||||
std::map<prv::Provider *, std::vector<std::shared_ptr<pl::Pattern>>> m_sortedPatterns;
|
||||
};
|
||||
|
||||
}
|
||||
@@ -51,7 +51,8 @@ namespace hex::plugin::builtin {
|
||||
std::map<std::string, PatternVariable> m_patternVariables;
|
||||
std::vector<std::string> m_patternTypes;
|
||||
|
||||
enum class EnvVarType {
|
||||
enum class EnvVarType
|
||||
{
|
||||
Integer,
|
||||
Float,
|
||||
String,
|
||||
@@ -77,7 +78,7 @@ namespace hex::plugin::builtin {
|
||||
void drawVariableSettings(ImVec2 size);
|
||||
|
||||
void loadPatternFile(const fs::path &path);
|
||||
void clearPatternData();
|
||||
void clearPatterns();
|
||||
|
||||
void parsePattern(const std::string &code);
|
||||
void evaluatePattern(const std::string &code);
|
||||
|
||||
Reference in New Issue
Block a user