mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-07-01 08:41:52 +00:00
parse variables
This commit is contained in:
@ -5,10 +5,11 @@
|
||||
#include "IHeaderBlock.h"
|
||||
#include "IHeaderBlockNameHolder.h"
|
||||
#include "IHeaderBlockVariableDefining.h"
|
||||
#include "IHeaderBlockVariableHolder.h"
|
||||
#include "Domain/Definition/StructDefinition.h"
|
||||
#include "Domain/Definition/Variable.h"
|
||||
|
||||
class HeaderBlockStruct final : public IHeaderBlock, public IHeaderBlockNameHolder, public IHeaderBlockVariableDefining
|
||||
class HeaderBlockStruct final : public IHeaderBlock, public IHeaderBlockNameHolder, public IHeaderBlockVariableDefining, public IHeaderBlockVariableHolder
|
||||
{
|
||||
std::string m_namespace;
|
||||
std::string m_type_name;
|
||||
@ -32,7 +33,7 @@ public:
|
||||
void OnClose(HeaderParserState* state) override;
|
||||
void OnChildBlockClose(HeaderParserState* state, IHeaderBlock* block) override;
|
||||
|
||||
void AddVariable(std::shared_ptr<Variable> variable);
|
||||
void AddVariable(std::shared_ptr<Variable> variable) override;
|
||||
void SetCustomAlignment(int alignment);
|
||||
void Inherit(const StructDefinition* parentStruct);
|
||||
|
||||
|
@ -3,8 +3,9 @@
|
||||
#include "IHeaderBlock.h"
|
||||
#include "IHeaderBlockNameHolder.h"
|
||||
#include "IHeaderBlockVariableDefining.h"
|
||||
#include "IHeaderBlockVariableHolder.h"
|
||||
|
||||
class HeaderBlockUnion final : public IHeaderBlock, public IHeaderBlockNameHolder, public IHeaderBlockVariableDefining
|
||||
class HeaderBlockUnion final : public IHeaderBlock, public IHeaderBlockNameHolder, public IHeaderBlockVariableDefining, public IHeaderBlockVariableHolder
|
||||
{
|
||||
std::string m_namespace;
|
||||
std::string m_type_name;
|
||||
@ -28,7 +29,7 @@ public:
|
||||
void OnClose(HeaderParserState* state) override;
|
||||
void OnChildBlockClose(HeaderParserState* state, IHeaderBlock* block) override;
|
||||
|
||||
void AddVariable(std::shared_ptr<Variable> variable);
|
||||
void AddVariable(std::shared_ptr<Variable> variable) override;
|
||||
void SetCustomAlignment(int alignment);
|
||||
void Inherit(const StructDefinition* parentStruct);
|
||||
|
||||
|
@ -0,0 +1,18 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "Domain/Definition/Variable.h"
|
||||
|
||||
class IHeaderBlockVariableHolder
|
||||
{
|
||||
public:
|
||||
IHeaderBlockVariableHolder() = default;
|
||||
virtual ~IHeaderBlockVariableHolder() = default;
|
||||
IHeaderBlockVariableHolder(const IHeaderBlockVariableHolder& other) = default;
|
||||
IHeaderBlockVariableHolder(IHeaderBlockVariableHolder&& other) noexcept = default;
|
||||
IHeaderBlockVariableHolder& operator=(const IHeaderBlockVariableHolder& other) = default;
|
||||
IHeaderBlockVariableHolder& operator=(IHeaderBlockVariableHolder&& other) noexcept = default;
|
||||
|
||||
virtual void AddVariable(std::shared_ptr<Variable> variable) = 0;
|
||||
};
|
Reference in New Issue
Block a user