2020-11-10 14:26:38 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "parser/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-14 13:42:21 +00:00
|
|
|
#include "views/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-12 20:20:51 +00:00
|
|
|
#include "imfilebrowser.h"
|
|
|
|
|
2020-11-10 14:26:38 +00:00
|
|
|
namespace hex {
|
|
|
|
|
|
|
|
class ViewPattern : public View {
|
|
|
|
public:
|
2020-11-14 13:42:21 +00:00
|
|
|
explicit ViewPattern(prv::Provider* &dataProvider, std::vector<hex::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-13 12:50:59 +00:00
|
|
|
char *m_buffer = nullptr;
|
2020-11-10 14:26:38 +00:00
|
|
|
|
2020-11-14 13:42:21 +00:00
|
|
|
std::vector<hex::PatternData*> &m_patternData;
|
2020-11-13 12:06:22 +00:00
|
|
|
prv::Provider* &m_dataProvider;
|
2020-11-10 16:34:11 +00:00
|
|
|
bool m_windowOpen = true;
|
2020-11-10 14:26:38 +00:00
|
|
|
|
2020-11-12 20:20:51 +00:00
|
|
|
ImGui::FileBrowser m_fileBrowser;
|
|
|
|
|
2020-11-10 14:26:38 +00:00
|
|
|
|
2020-11-14 13:42:21 +00:00
|
|
|
void addPatternData(PatternData *patternData);
|
|
|
|
void clearPatternData();
|
2020-11-10 20:31:04 +00:00
|
|
|
void parsePattern(char *buffer);
|
2020-11-10 14:26:38 +00:00
|
|
|
|
2020-11-13 10:37:43 +00: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 13:42:21 +00:00
|
|
|
s32 highlightEnum(std::vector<lang::ASTNode*> &ast, lang::ASTNodeEnum* currEnumNode, u64 offset, std::string name);
|
2020-11-10 14:26:38 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|