1
0
mirror of synced 2024-11-18 04:47:12 +01:00
ImHex/include/views/view_pattern_editor.hpp
WerWolv e74c0f5cf5 sys: Tons of long overdue cleanup
- std::string -> const std::string& where needed
- Added a FileIO abstraction class
- Fixed recent files not updating
- Removed localization file from global include
- Renamed lang to pattern_language/pl
- Renamed EventFileDropped to RequestFileOpen
2021-09-08 15:18:24 +02:00

43 lines
1.0 KiB
C++

#pragma once
#include <hex/views/view.hpp>
#include <hex/pattern_language/evaluator.hpp>
#include <hex/pattern_language/pattern_language.hpp>
#include <hex/providers/provider.hpp>
#include <cstring>
#include <filesystem>
#include <string_view>
#include <thread>
#include <vector>
#include <TextEditor.h>
namespace hex {
class ViewPatternEditor : public View {
public:
ViewPatternEditor();
~ViewPatternEditor() override;
void drawMenu() override;
void drawAlwaysVisible() override;
void drawContent() override;
private:
pl::PatternLanguage *m_patternLanguageRuntime;
std::vector<std::string> m_possiblePatternFiles;
int m_selectedPatternFile = 0;
bool m_runAutomatically = false;
bool m_evaluatorRunning = false;
TextEditor m_textEditor;
std::vector<std::pair<pl::LogConsole::Level, std::string>> m_console;
void loadPatternFile(const std::string &path);
void clearPatternData();
void parsePattern(char *buffer);
};
}