summaryrefslogtreecommitdiff
path: root/server/src/templatelist.h
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/templatelist.h')
-rw-r--r--server/src/templatelist.h42
1 files changed, 4 insertions, 38 deletions
diff --git a/server/src/templatelist.h b/server/src/templatelist.h
index a037956..ce2d1b3 100644
--- a/server/src/templatelist.h
+++ b/server/src/templatelist.h
@@ -28,48 +28,14 @@
#ifndef __PRACRO_TEMPLATELIST_H__
#define __PRACRO_TEMPLATELIST_H__
-#include <map>
-#include <string>
-#include "versionstr.h"
-#include "templatelist.h"
-#include "mutex.h"
+#include "entitylist.h"
-#include "exception.h"
-
-/**
- * The Items contained in the TemplateList.
- */
-typedef std::map<VersionStr, std::string> TemplateListItem;
-
-/**
- * The TemplateList class is intended for template file caching, so that all templates
- * do not need to be parsed on each template query.
- * It builds a list of templates and versions based on the informations read from
- * the TemplateHeaderParser.
- * This means that just because a template gets into the list doesn't means that it
- * will validate as a correct template (not even nessecarily correct XML).
- */
-class TemplateList : public std::map<std::string, TemplateListItem > {
+class TemplateList : public EntityList {
public:
- /**
- * Constructor.
- * @param templatepath A std::string containing the path in which we should look
- * for xml files.
- */
- TemplateList(std::string templatepath);
-
- /**
- * Convenience method, to gain the filename of the latest version of a given template.
- * This method throws an Exception if the template does not exist in the tree.
- * @param template A std::string containing the name of the wanted template.
- * @return A std::string containing the file containing the template with full path
- * included.
- */
- std::string getLatestVersion(std::string templ) throw(Exception);
+ TemplateList(std::string path);
private:
- Mutex mutex;
- std::string templatepath;
+ void addFile(std::string file);
};
#endif/*__PRACRO_TEMPLATELIST_H__*/