2020-11-10 14:26:38 +00:00
|
|
|
#pragma once
|
|
|
|
|
2020-11-17 01:31:51 +00:00
|
|
|
#include "lang/ast_node.hpp"
|
2020-11-13 12:06:22 +00:00
|
|
|
|
2020-11-10 14:26:38 +00:00
|
|
|
#include "views/view.hpp"
|
2020-11-19 10:36:52 +00:00
|
|
|
#include "lang/pattern_data.hpp"
|
2020-11-13 12:06:22 +00:00
|
|
|
|
|
|
|
#include "providers/provider.hpp"
|
2020-11-10 14:26:38 +00:00
|
|
|
|
|
|
|
#include <concepts>
|
|
|
|
#include <cstring>
|
2020-11-21 13:39:16 +00:00
|
|
|
#include <filesystem>
|
2020-11-10 14:26:38 +00:00
|
|
|
|
2020-11-17 14:38:24 +00:00
|
|
|
#include "ImGuiFileBrowser.h"
|
2020-11-20 17:24:59 +00:00
|
|
|
#include "TextEditor.h"
|
2020-11-12 20:20:51 +00:00
|
|
|
|
2020-11-10 14:26:38 +00:00
|
|
|
namespace hex {
|
|
|
|
|
|
|
|
class ViewPattern : public View {
|
|
|
|
public:
|
2020-11-19 10:36:52 +00:00
|
|
|
explicit ViewPattern(prv::Provider* &dataProvider, std::vector<lang::PatternData*> &patternData);
|
2020-11-11 08:28:44 +00:00
|
|
|
~ViewPattern() override;
|
2020-11-10 14:26:38 +00:00
|
|
|
|
2020-11-11 08:28:44 +00:00
|
|
|
void createMenu() override;
|
|
|
|
void createView() override;
|
2020-11-10 14:26:38 +00:00
|
|
|
|
|
|
|
private:
|
2020-11-19 10:36:52 +00:00
|
|
|
std::vector<lang::PatternData*> &m_patternData;
|
2020-11-13 12:06:22 +00:00
|
|
|
prv::Provider* &m_dataProvider;
|
2020-11-21 13:39:16 +00:00
|
|
|
std::filesystem::path m_possiblePatternFile;
|
2020-11-10 14:26:38 +00:00
|
|
|
|
2020-11-20 17:24:59 +00:00
|
|
|
TextEditor m_textEditor;
|
2020-11-17 14:38:24 +00:00
|
|
|
imgui_addons::ImGuiFileBrowser m_fileBrowser;
|
2020-11-12 20:20:51 +00:00
|
|
|
|
2020-11-21 13:39:16 +00:00
|
|
|
void loadPatternFile(std::string path);
|
2020-11-14 13:42:21 +00:00
|
|
|
void clearPatternData();
|
2020-11-10 20:31:04 +00:00
|
|
|
void parsePattern(char *buffer);
|
2020-11-10 14:26:38 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|