From 984d1dd9993aa5beffa4270b6421dea05ab04faa Mon Sep 17 00:00:00 2001 From: deva Date: Thu, 14 Jan 2010 13:48:52 +0000 Subject: Made EntityList superclass for the Macro and TemplateList classes. --- server/src/templatelist.h | 42 ++++-------------------------------------- 1 file changed, 4 insertions(+), 38 deletions(-) (limited to 'server/src/templatelist.h') 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 -#include -#include "versionstr.h" -#include "templatelist.h" -#include "mutex.h" +#include "entitylist.h" -#include "exception.h" - -/** - * The Items contained in the TemplateList. - */ -typedef std::map 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 { +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__*/ -- cgit v1.2.3