1
0
mirror of synced 2024-11-18 12:57:12 +01:00
ImHex/include/views/view_pattern.hpp

37 lines
968 B
C++
Raw Normal View History

#pragma once
#include "parser/ast_node.hpp"
#include "parser/parser.hpp"
#include "parser/lexer.hpp"
#include "views/view.hpp"
#include <concepts>
#include <cstring>
2020-11-10 21:31:04 +01:00
#include "views/highlight.hpp"
namespace hex {
class ViewPattern : public View {
public:
2020-11-11 09:28:44 +01:00
explicit ViewPattern(std::vector<Highlight> &highlights);
~ViewPattern() override;
2020-11-11 09:28:44 +01:00
void createMenu() override;
void createView() override;
private:
char *m_buffer;
2020-11-10 21:31:04 +01:00
std::vector<Highlight> &m_highlights;
2020-11-10 17:34:11 +01:00
bool m_windowOpen = true;
2020-11-10 21:31:04 +01:00
void setHighlight(u64 offset, size_t size, std::string name, u32 color = 0);
void parsePattern(char *buffer);
2020-11-10 21:31:04 +01:00
s32 highlightUsingDecls(std::vector<lang::ASTNode*> &ast, lang::ASTNodeTypeDecl* currTypeDeclNode, lang::ASTNodeVariableDecl* currVarDec, u64 offset);
s32 highlightStruct(std::vector<lang::ASTNode*> &ast, lang::ASTNodeStruct* currStructNode, u64 offset);
};
}