summaryrefslogtreecommitdiff
path: root/server/src/macrolist.h
diff options
context:
space:
mode:
authordeva <deva>2009-07-24 09:11:52 +0000
committerdeva <deva>2009-07-24 09:11:52 +0000
commit511859ef8028bb75032a965b490faa67b174a4e6 (patch)
treef803fce448b03f9a0586a493484983ea59215025 /server/src/macrolist.h
parentcdc1e51494c6afc16f00e2d5829db5250a801f42 (diff)
Made some more tests, and documented the header file.
Diffstat (limited to 'server/src/macrolist.h')
-rw-r--r--server/src/macrolist.h29
1 files changed, 27 insertions, 2 deletions
diff --git a/server/src/macrolist.h b/server/src/macrolist.h
index 328e522..9b9b0d2 100644
--- a/server/src/macrolist.h
+++ b/server/src/macrolist.h
@@ -32,13 +32,38 @@
#include <string>
#include "versionstr.h"
+#include "exception.h"
+
+/**
+ * The Items contained in the MacroList.
+ */
typedef std::map<VersionStr, std::string> MacroListItem;
+/**
+ * The MacroList class is intended for macro file caching, so that all macros
+ * do not need to be parsed on each macro query.
+ * It builds a list of macros and versions based on the informations read from
+ * the MacroHeaderParser.
+ * This means that just because a macro gets into the list doesn't means that it
+ * will validate as a correct macro (not even nessecarily correct XML).
+ */
class MacroList : public std::map<std::string, MacroListItem > {
public:
+ /**
+ * Constructor.
+ * @param macropath A std::string containing the path in which we should look
+ * for xml files.
+ */
MacroList(std::string macropath);
-
- std::string getLatestVersion(std::string macro);
+
+ /**
+ * Convenience method, to gain the filename of the latest version of a given macro.
+ * This method throws an Exception if the macro does not exist in the tree.
+ * @param macro A std::string containing the name of the wanted macro.
+ * @return A std::string containing the file containing the macro with full path
+ * included.
+ */
+ std::string getLatestVersion(std::string macro) throw(Exception);
private:
std::string macropath;