dropshell/src/templates.hpp
2025-04-21 11:47:07 +12:00

30 lines
862 B
C++

#include <string>
#include <vector>
namespace dropshell {
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);
};
} // namespace dropshell