2020-11-10 15:26:38 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "parser/ast_node.hpp"
|
|
|
|
#include "parser/parser.hpp"
|
|
|
|
#include "parser/lexer.hpp"
|
2020-11-13 13:06:22 +01:00
|
|
|
|
2020-11-10 15:26:38 +01:00
|
|
|
#include "views/view.hpp"
|
2020-11-14 14:42:21 +01:00
|
|
|
#include "views/pattern_data.hpp"
|
2020-11-13 13:06:22 +01:00
|
|
|
|
|
|
|
#include "providers/provider.hpp"
|
2020-11-10 15:26:38 +01:00
|
|
|
|
|
|
|
#include <concepts>
|
|
|
|
#include <cstring>
|
|
|
|
|
|
|
|
|
2020-11-12 21:20:51 +01:00
|
|
|
#include "imfilebrowser.h"
|
|
|
|
|
2020-11-10 15:26:38 +01:00
|
|
|
namespace hex {
|
|
|
|
|
|
|
|
class ViewPattern : public View {
|
|
|
|
public:
|
2020-11-14 14:42:21 +01:00
|
|
|
explicit ViewPattern(prv::Provider* &dataProvider, std::vector<hex::PatternData*> &patternData);
|
2020-11-11 09:28:44 +01:00
|
|
|
~ViewPattern() override;
|
2020-11-10 15:26:38 +01:00
|
|
|
|
2020-11-11 09:28:44 +01:00
|
|
|
void createMenu() override;
|
|
|
|
void createView() override;
|
2020-11-10 15:26:38 +01:00
|
|
|
|
|
|
|
private:
|
2020-11-13 13:50:59 +01:00
|
|
|
char *m_buffer = nullptr;
|
2020-11-10 15:26:38 +01:00
|
|
|
|
2020-11-14 14:42:21 +01:00
|
|
|
std::vector<hex::PatternData*> &m_patternData;
|
2020-11-13 13:06:22 +01:00
|
|
|
prv::Provider* &m_dataProvider;
|
2020-11-10 17:34:11 +01:00
|
|
|
bool m_windowOpen = true;
|
2020-11-10 15:26:38 +01:00
|
|
|
|
2020-11-12 21:20:51 +01:00
|
|
|
ImGui::FileBrowser m_fileBrowser;
|
|
|
|
|
2020-11-10 15:26:38 +01:00
|
|
|
|
2020-11-14 14:42:21 +01:00
|
|
|
void addPatternData(PatternData *patternData);
|
|
|
|
void clearPatternData();
|
2020-11-10 21:31:04 +01:00
|
|
|
void parsePattern(char *buffer);
|
2020-11-10 15:26:38 +01:00
|
|
|
|
2020-11-13 11:37:43 +01:00
|
|
|
s32 highlightUsingDecls(std::vector<lang::ASTNode*> &ast, lang::ASTNodeTypeDecl* currTypeDeclNode, lang::ASTNodeVariableDecl* currVarDec, u64 offset, std::string name);
|
|
|
|
s32 highlightStruct(std::vector<lang::ASTNode*> &ast, lang::ASTNodeStruct* currStructNode, u64 offset, std::string name);
|
2020-11-14 14:42:21 +01:00
|
|
|
s32 highlightEnum(std::vector<lang::ASTNode*> &ast, lang::ASTNodeEnum* currEnumNode, u64 offset, std::string name);
|
2020-11-10 15:26:38 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|