mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-07-01 17:17:55 -05:00
chore: use std::format for zcg templates
This commit is contained in:
@ -7,13 +7,13 @@
|
||||
#include "Domain/Evaluation/Operation.h"
|
||||
#include "Generating/RenderingContext.h"
|
||||
|
||||
#include <format>
|
||||
#include <ostream>
|
||||
#include <sstream>
|
||||
|
||||
class BaseTemplate
|
||||
{
|
||||
protected:
|
||||
static constexpr const char* INTENDATION = " ";
|
||||
static constexpr auto INTENDATION = " ";
|
||||
|
||||
BaseTemplate(std::ostream& stream, RenderingContext* context);
|
||||
|
||||
@ -26,16 +26,17 @@ protected:
|
||||
static std::string MakeTypePtrVarName(const DataDefinition* def);
|
||||
static std::string MakeTypeWrittenPtrVarName(const DataDefinition* def);
|
||||
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 StructureInformation* info, const MemberInformation* member, const DeclarationModifierComputations& modifier);
|
||||
static std::string
|
||||
MakeWrittenMemberAccess(const StructureInformation* info, const MemberInformation* member, const DeclarationModifierComputations& modifier);
|
||||
static std::string MakeMemberAccess(const std::string& variableName,
|
||||
StructureInformation* info,
|
||||
MemberInformation* member,
|
||||
const 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);
|
||||
static std::string MakeCustomActionCall(CustomAction* action);
|
||||
static std::string MakeCustomActionCall(const CustomAction* action);
|
||||
static std::string MakeArrayCount(const ArrayDeclarationModifier* arrayModifier);
|
||||
static std::string MakeEvaluation(const IEvaluation* evaluation);
|
||||
|
||||
@ -61,16 +62,34 @@ private:
|
||||
DoIntendation(); \
|
||||
m_out << x << "\n"; \
|
||||
}
|
||||
#define LINEF(...) \
|
||||
{ \
|
||||
DoIntendation(); \
|
||||
m_out << std::format(__VA_ARGS__) << "\n"; \
|
||||
}
|
||||
#define LINE_START(x) \
|
||||
{ \
|
||||
DoIntendation(); \
|
||||
m_out << x; \
|
||||
}
|
||||
#define LINE_STARTF(...) \
|
||||
{ \
|
||||
DoIntendation(); \
|
||||
m_out << std::format(__VA_ARGS__); \
|
||||
}
|
||||
#define LINE_MIDDLE(x) \
|
||||
{ \
|
||||
m_out << x; \
|
||||
}
|
||||
#define LINE_MIDDLEF(...) \
|
||||
{ \
|
||||
m_out << std::format(__VA_ARGS__); \
|
||||
}
|
||||
#define LINE_END(x) \
|
||||
{ \
|
||||
m_out << x << "\n"; \
|
||||
}
|
||||
#define LINE_ENDF(...) \
|
||||
{ \
|
||||
m_out << std::format(__VA_ARGS__) << "\n"; \
|
||||
}
|
||||
|
Reference in New Issue
Block a user