This commit is contained in:
Your Name
2025-04-21 11:29:39 +12:00
parent 10d663971c
commit 43a10f5c3f
4 changed files with 36 additions and 1 deletions

22
src/templates.hpp Normal file
View File

@ -0,0 +1,22 @@
class template_info {
public:
std::string name;
std::string path;
};
// templates are stored in two locations:
// 1. /opt/dropshell/templates
// 2. CONFIG_DIR/usertemplates (if it exists)
// we aggregate the templates from both locations and return them in the order of priority.
// if a template exists in both locations, the one in the user directory takes precedence.
// the template name is just the subfolder name in the templates directory.
// the template path is the path of that subfolder.
class template_manager {
public:
template_manager();
~template_manager();
bool get_templates(std::vector<template_info>& templates);
bool get_template_info(const std::string& name, template_info& info);
};