summaryrefslogtreecommitdiff
path: root/server/src/resumeparser.cc
diff options
context:
space:
mode:
authordeva <deva>2009-01-13 10:01:52 +0000
committerdeva <deva>2009-01-13 10:01:52 +0000
commitf2710089a722fc55970813fab2d27ae3e23a9c97 (patch)
treec17c89cd0e3a3fc72abf6e21a9293c16703b0db4 /server/src/resumeparser.cc
parenta58622afba64661df051ee6454cb62643936356f (diff)
Added a 'language' tag in resume, to be able to switch parser. Implemented the lua resume parser.
Diffstat (limited to 'server/src/resumeparser.cc')
-rw-r--r--server/src/resumeparser.cc21
1 files changed, 20 insertions, 1 deletions
diff --git a/server/src/resumeparser.cc b/server/src/resumeparser.cc
index 45d3645..bf3483e 100644
--- a/server/src/resumeparser.cc
+++ b/server/src/resumeparser.cc
@@ -26,10 +26,13 @@
*/
#include "resumeparser.h"
+#include "luaresume.h"
#include <string.h>
-std::string resume_parser(const char *format, Commit &commit)
+static std::string resume_parser_format(Resume &r, Commit &commit)
{
+ const char* format = r.attributes["format"].c_str();
+
std::string resume;
std::string var;
@@ -95,3 +98,19 @@ std::string resume_parser(const char *format, Commit &commit)
return resume;
}
+
+static std::string resume_parser_lua(Resume &resume, Commit &commit)
+{
+ LUAResume luaresume(commit);
+
+ return luaresume.run(resume.attributes["format"]);
+}
+
+std::string resume_parser(Resume &resume, Commit &commit)
+{
+ if(resume.attributes["language"] == "lua")
+ return resume_parser_lua(resume, commit);
+
+ // Default to pracro format language.
+ return resume_parser_format(resume, commit);
+}