2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2025-06-28 23:31:54 +00:00

Reformat code with clang format

This commit is contained in:
Clang Format
2023-11-19 15:28:38 +01:00
committed by Jan
parent 22e17272fd
commit 6b4f5d94a8
1099 changed files with 16763 additions and 18076 deletions

View File

@ -1,11 +1,10 @@
#include "BaseTemplate.h"
#include <sstream>
#include "Domain/Computations/MemberComputations.h"
#include "Domain/Definition/ArrayDeclarationModifier.h"
#include <sstream>
BaseTemplate::BaseTemplate(std::ostream& stream, RenderingContext* context)
: m_out(stream),
m_env(*context),
@ -88,7 +87,6 @@ std::string BaseTemplate::MakeTypeVarName(const DataDefinition* def)
return str.str();
}
std::string BaseTemplate::MakeTypeWrittenVarName(const DataDefinition* def)
{
std::ostringstream str;
@ -137,7 +135,10 @@ std::string BaseTemplate::MakeWrittenMemberAccess(StructureInformation* info, Me
return str.str();
}
std::string BaseTemplate::MakeMemberAccess(const std::string& variableName, StructureInformation* info, MemberInformation* member, const DeclarationModifierComputations& modifier)
std::string BaseTemplate::MakeMemberAccess(const std::string& variableName,
StructureInformation* info,
MemberInformation* member,
const DeclarationModifierComputations& modifier)
{
std::ostringstream str;
str << variableName << "->" << member->m_member->m_name;
@ -210,7 +211,7 @@ std::string BaseTemplate::MakeCustomActionCall(CustomAction* action)
std::string BaseTemplate::MakeArrayCount(const ArrayDeclarationModifier* arrayModifier)
{
if(arrayModifier->m_dynamic_count_evaluation)
if (arrayModifier->m_dynamic_count_evaluation)
{
return MakeEvaluation(arrayModifier->m_dynamic_count_evaluation.get());
}
@ -234,11 +235,11 @@ void BaseTemplate::MakeOperandDynamic(const OperandDynamic* op, std::ostringstre
{
MakeTypeVarNameInternal(op->m_structure->m_definition, str);
if(!op->m_referenced_member_chain.empty())
if (!op->m_referenced_member_chain.empty())
{
str << "->";
const auto lastEntry = op->m_referenced_member_chain.end() - 1;
for(auto i = op->m_referenced_member_chain.begin(); i != lastEntry; ++i)
for (auto i = op->m_referenced_member_chain.begin(); i != lastEntry; ++i)
{
MemberComputations computations(*i);
str << (*i)->m_member->m_name;

View File

@ -1,8 +1,5 @@
#pragma once
#include <ostream>
#include <sstream>
#include "Domain/Computations/MemberDeclarationModifierComputations.h"
#include "Domain/Definition/ArrayDeclarationModifier.h"
#include "Domain/Evaluation/OperandDynamic.h"
@ -10,6 +7,9 @@
#include "Domain/Evaluation/Operation.h"
#include "Generating/RenderingContext.h"
#include <ostream>
#include <sstream>
class BaseTemplate
{
protected:
@ -45,7 +45,10 @@ protected:
static std::string MakeSafeTypeName(const DataDefinition* def);
static std::string MakeMemberAccess(StructureInformation* info, MemberInformation* member, const DeclarationModifierComputations& modifier);
static std::string MakeWrittenMemberAccess(StructureInformation* info, MemberInformation* member, const DeclarationModifierComputations& modifier);
static std::string MakeMemberAccess(const std::string& variableName, StructureInformation* info, MemberInformation* member, const DeclarationModifierComputations& modifier);
static std::string MakeMemberAccess(const std::string& variableName,
StructureInformation* info,
MemberInformation* member,
const DeclarationModifierComputations& modifier);
static std::string MakeTypeDecl(const TypeDeclaration* decl);
static std::string MakeFollowingReferences(const std::vector<DeclarationModifier*>& modifiers);
static std::string MakeArrayIndices(const DeclarationModifierComputations& modifierComputations);
@ -54,7 +57,21 @@ protected:
static std::string MakeEvaluation(const IEvaluation* evaluation);
};
#define LINE(x) {DoIntendation(); m_out << x << "\n";}
#define LINE_START(x) {DoIntendation(); m_out << x;}
#define LINE_MIDDLE(x) {m_out << x;}
#define LINE_END(x) {m_out << x << "\n";}
#define LINE(x) \
{ \
DoIntendation(); \
m_out << x << "\n"; \
}
#define LINE_START(x) \
{ \
DoIntendation(); \
m_out << x; \
}
#define LINE_MIDDLE(x) \
{ \
m_out << x; \
}
#define LINE_END(x) \
{ \
m_out << x << "\n"; \
}