mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-04-21 08:35:43 +00:00
45 lines
1.4 KiB
C++
45 lines
1.4 KiB
C++
#pragma once
|
|
|
|
#include "Domain/Definition/StructDefinition.h"
|
|
#include "Domain/Definition/Variable.h"
|
|
#include "IHeaderBlock.h"
|
|
#include "IHeaderBlockNameHolder.h"
|
|
#include "IHeaderBlockVariableDefining.h"
|
|
#include "IHeaderBlockVariableHolder.h"
|
|
|
|
#include <string>
|
|
|
|
class HeaderBlockStruct final : public IHeaderBlock, public IHeaderBlockNameHolder, public IHeaderBlockVariableDefining, public IHeaderBlockVariableHolder
|
|
{
|
|
std::string m_namespace;
|
|
std::string m_type_name;
|
|
std::vector<std::shared_ptr<Variable>> m_members;
|
|
StructDefinition* m_struct_definition;
|
|
|
|
int m_custom_alignment;
|
|
|
|
bool m_is_typedef;
|
|
bool m_has_custom_align;
|
|
bool m_is_anonymous;
|
|
|
|
std::string m_variable_name;
|
|
|
|
public:
|
|
HeaderBlockStruct(std::string name, bool isTypedef);
|
|
|
|
HeaderBlockType GetType() override;
|
|
const std::vector<sequence_t*>& GetTestsForBlock() override;
|
|
void OnOpen(HeaderParserState* state) override;
|
|
void OnClose(HeaderParserState* state) override;
|
|
void OnChildBlockClose(HeaderParserState* state, IHeaderBlock* block) override;
|
|
|
|
void AddVariable(std::shared_ptr<Variable> variable) override;
|
|
void SetCustomAlignment(int alignment);
|
|
void Inherit(const StructDefinition* parentStruct);
|
|
|
|
void SetBlockName(const TokenPos& nameTokenPos, std::string name) override;
|
|
bool IsDefiningVariable() override;
|
|
DataDefinition* GetVariableType() override;
|
|
std::string GetVariableName() override;
|
|
};
|