ImHex/include/views/view_pattern.hpp

44 lines
1.1 KiB
C++
Raw Normal View History

#pragma once
#include <hex/views/view.hpp>
#include <hex/lang/evaluator.hpp>
#include <hex/lang/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 ViewPattern : public View {
public:
explicit ViewPattern(std::vector<lang::PatternData*> &patternData);
2020-11-11 08:28:44 +00:00
~ViewPattern() override;
void drawMenu() override;
void drawAlwaysVisible() override;
void drawContent() override;
private:
lang::PatternLanguage *m_patternLanguageRuntime;
std::vector<lang::PatternData*> &m_patternData;
std::vector<std::string> m_possiblePatternFiles;
int m_selectedPatternFile = 0;
bool m_runAutomatically = false;
2021-02-22 10:56:33 +00:00
bool m_evaluatorRunning = false;
TextEditor m_textEditor;
std::vector<std::pair<lang::LogConsole::Level, std::string>> m_console;
void loadPatternFile(std::string_view path);
void clearPatternData();
2020-11-10 20:31:04 +00:00
void parsePattern(char *buffer);
};
}