Added auto loading patterns based on MIME types

This commit is contained in:
WerWolv
2020-11-21 14:39:16 +01:00
parent fb85f272a1
commit 4cd18b8358
5 changed files with 126 additions and 43 deletions

View File

@@ -16,4 +16,10 @@ using s64 = std::int64_t;
using s128 = __int128_t;
#include "lang/result.hpp"
#include "lang/results.hpp"
#include "lang/results.hpp"
#if defined(__EMX__) || defined (WIN32)
#define MAGIC_PATH_SEPARATOR ";"
#else
#define MAGIC_PATH_SEPARATOR ":"
#endif

View File

@@ -9,7 +9,7 @@
#include <concepts>
#include <cstring>
#include <filesystem>
#include "ImGuiFileBrowser.h"
#include "TextEditor.h"
@@ -27,11 +27,13 @@ namespace hex {
private:
std::vector<lang::PatternData*> &m_patternData;
prv::Provider* &m_dataProvider;
std::filesystem::path m_possiblePatternFile;
bool m_windowOpen = true;
TextEditor m_textEditor;
imgui_addons::ImGuiFileBrowser m_fileBrowser;
void loadPatternFile(std::string path);
void clearPatternData();
void parsePattern(char *buffer);
};