summaryrefslogtreecommitdiff
path: root/server/src/queryparser.cc
diff options
context:
space:
mode:
authordeva <deva>2008-09-30 12:49:34 +0000
committerdeva <deva>2008-09-30 12:49:34 +0000
commite2120257dda4d91b48bb031a96edda810ce30dfb (patch)
treef83eadbbb6d84fd0d6fb7d7a4d3e342535854795 /server/src/queryparser.cc
parenta01f655935558e0f71253907fd8e4c57b0d2f64c (diff)
Changed SAXParser parse method to take a buffer and a size instead of a c++ string. Made the queryhandler use a read loop, parsing on-the-fly to determine when the entire document has been read.
Diffstat (limited to 'server/src/queryparser.cc')
-rw-r--r--server/src/queryparser.cc15
1 files changed, 1 insertions, 14 deletions
diff --git a/server/src/queryparser.cc b/server/src/queryparser.cc
index 0135515..abb41b5 100644
--- a/server/src/queryparser.cc
+++ b/server/src/queryparser.cc
@@ -26,14 +26,10 @@
*/
#include "queryparser.h"
-QueryParser::QueryParser(std::string document)
+QueryParser::QueryParser()
{
- this->document = document;
this->timestamp = 0;
- // Make sure we always contain a valid xml document.
- if(this->document == "") this->document = "<xml></xml>";
-
p = 0;
stack.push_back(&result);
}
@@ -72,15 +68,6 @@ void QueryParser::endTag(std::string name)
if(name == "group") stack.pop_back();
}
-// FIXME: This is *not* the optimal way to do this.
-int QueryParser::readData(char *data, size_t size)
-{
- size_t len = document.size() - p < size ? document.size() - p : size;
- strncpy(data, document.c_str() + p, len);
- p += len;
- return len;
-}
-
void QueryParser::parseError(char *buf, size_t len, std::string error, int lineno)
{
fprintf(stderr, "QueryParser error at line %d: %s\n", lineno, error.c_str());