diff options
Diffstat (limited to 'server/src/resumeparser.cc')
-rw-r--r-- | server/src/resumeparser.cc | 21 |
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); +} |