.
This commit is contained in:
22
src/templates.hpp
Normal file
22
src/templates.hpp
Normal 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);
|
||||
};
|
Reference in New Issue
Block a user