summaryrefslogtreecommitdiff
path: root/server/src/server.cc
diff options
context:
space:
mode:
authordeva <deva>2008-03-26 13:04:30 +0000
committerdeva <deva>2008-03-26 13:04:30 +0000
commit6e76c4540e37280d0c161e7d7035e2e9022b18ce (patch)
tree97dffd6ddc732890c97ca41c7149cb1ac1afac6e /server/src/server.cc
parentfdb7aadb054f233401a9f3dd882b79ac5ccd5191 (diff)
Implemented a SAXPaser class, and made the macro and xml parsers use it.
Diffstat (limited to 'server/src/server.cc')
-rw-r--r--server/src/server.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/server/src/server.cc b/server/src/server.cc
index 2a4c882..930a6e7 100644
--- a/server/src/server.cc
+++ b/server/src/server.cc
@@ -81,7 +81,8 @@ static void connection(TCPSocket &socket)
printf("Got connection...\n");
Transaction transaction;
- parse(socket, transaction);
+ XMLParser parser(socket, transaction);
+ parser.parse();
socket.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
socket.write("<pracro version=\"1.0\">\n");
@@ -94,7 +95,8 @@ static void connection(TCPSocket &socket)
printf("Handling request for \"%s\"...", request.macro.c_str());
Macro macro;
- parse_macro(request.macro, macro);
+ MacroParser parser(request.macro, macro);
+ parser.parse();
socket.write(" <macro version=\"" + macro.version + "\" name=\""
+ macro.name + "\" resume=\"" + macro.format + "\">\n");
@@ -122,7 +124,8 @@ static void connection(TCPSocket &socket)
db.post(transaction.user, transaction.cpr, now, commit);
Macro macro;
- parse_macro(commit.macro, macro);
+ MacroParser parser(commit.macro, macro);
+ parser.parse();
std::string resume = resume_parser(macro.format.c_str(), commit);