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:
WerWolv
2022-02-27 23:25:39 +01:00
committed by GitHub
parent b28eaf2dbf
commit 66d1b3fd2f
85 changed files with 4990 additions and 5146 deletions

View File

@@ -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;

View File

@@ -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;
};
}

View File

@@ -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);