From aa8953dd8e1febdfcfa76fdc23e5e3ad9ad00d34 Mon Sep 17 00:00:00 2001 From: Sandu Liviu Catalin Date: Thu, 23 Mar 2023 20:23:35 +0200 Subject: [PATCH] Add a placeholder template library. --- module/Library/Utils/Template.cpp | 13 ++++++++ module/Library/Utils/Template.hpp | 50 +++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 module/Library/Utils/Template.cpp create mode 100644 module/Library/Utils/Template.hpp diff --git a/module/Library/Utils/Template.cpp b/module/Library/Utils/Template.cpp new file mode 100644 index 00000000..86ee63a1 --- /dev/null +++ b/module/Library/Utils/Template.cpp @@ -0,0 +1,13 @@ +// ------------------------------------------------------------------------------------------------ +#include "Library/Utils/Template.hpp" + +// ------------------------------------------------------------------------------------------------ +namespace SqMod { + +// ================================================================================================ +void Register_Template(HSQUIRRELVM vm, Table & ns) +{ + +} + +} // Namespace:: SqMod diff --git a/module/Library/Utils/Template.hpp b/module/Library/Utils/Template.hpp new file mode 100644 index 00000000..8191bab2 --- /dev/null +++ b/module/Library/Utils/Template.hpp @@ -0,0 +1,50 @@ +#pragma once + +// ------------------------------------------------------------------------------------------------ +#include "Core/Utility.hpp" + +// ------------------------------------------------------------------------------------------------ +#include + +// ------------------------------------------------------------------------------------------------ +namespace SqMod { + +/* ------------------------------------------------------------------------------------------------ + * +*/ +struct SqTemplateData +{ + /* -------------------------------------------------------------------------------------------- + * JSON data. + */ + nlohmann::json mData{}; + +}; + +/* ------------------------------------------------------------------------------------------------ + * +*/ +struct SqTemplateEnvironment +{ + /* -------------------------------------------------------------------------------------------- + * Environment instance. + */ + inja::Environment mEnv{}; + + +}; + +/* ------------------------------------------------------------------------------------------------ + * Template engine loosely inspired by jinja for python. +*/ +struct SqTemplateInstance +{ + /* -------------------------------------------------------------------------------------------- + * Template instance. + */ + inja::Template mTpl{}; + + +}; + +} // Namespace:: SqMod