1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2024-11-08 00:37:15 +01:00

Add a placeholder template library.

This commit is contained in:
Sandu Liviu Catalin 2023-03-23 20:23:35 +02:00
parent fa79a51c46
commit aa8953dd8e
2 changed files with 63 additions and 0 deletions

View File

@ -0,0 +1,13 @@
// ------------------------------------------------------------------------------------------------
#include "Library/Utils/Template.hpp"
// ------------------------------------------------------------------------------------------------
namespace SqMod {
// ================================================================================================
void Register_Template(HSQUIRRELVM vm, Table & ns)
{
}
} // Namespace:: SqMod

View File

@ -0,0 +1,50 @@
#pragma once
// ------------------------------------------------------------------------------------------------
#include "Core/Utility.hpp"
// ------------------------------------------------------------------------------------------------
#include <inja/inja.hpp>
// ------------------------------------------------------------------------------------------------
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