summaryrefslogtreecommitdiff
path: root/server/src
diff options
context:
space:
mode:
authordeva <deva>2008-05-13 09:56:55 +0000
committerdeva <deva>2008-05-13 09:56:55 +0000
commitf0359e8b4450d5074e7d19e95119f05d584a1e74 (patch)
tree8fd194eb6cd8b0013f33df3eda39ccce81375361 /server/src
parenteffac436c84214e2dd8556e7a17c217e3282bda5 (diff)
More filename cleanup..
Diffstat (limited to 'server/src')
-rw-r--r--server/src/Makefile.am8
-rw-r--r--server/src/server.cc4
-rw-r--r--server/src/transactionparser.cc (renamed from server/src/xmlparser.cc)24
-rw-r--r--server/src/transactionparser.h (renamed from server/src/xmlparser.h)12
4 files changed, 24 insertions, 24 deletions
diff --git a/server/src/Makefile.am b/server/src/Makefile.am
index 621e8dd..251560b 100644
--- a/server/src/Makefile.am
+++ b/server/src/Makefile.am
@@ -21,10 +21,10 @@ pracrod_SOURCES = \
saxparser.cc \
server.cc \
templateparser.cc \
+ transactionparser.cc \
tcpsocket.cc \
tostring.cc \
- uid.cc \
- xmlparser.cc
+ uid.cc
EXTRA_DIST = \
configuration.h \
@@ -43,7 +43,7 @@ EXTRA_DIST = \
saxparser.h \
server.h \
templateparser.h \
+ transactionparser.h \
tcpsocket.h \
tostring.h \
- uid.h \
- xmlparser.h
+ uid.h
diff --git a/server/src/server.cc b/server/src/server.cc
index 930a6e7..f6c1771 100644
--- a/server/src/server.cc
+++ b/server/src/server.cc
@@ -38,7 +38,7 @@
#include "configuration.h"
#include "transaction.h"
-#include "xmlparser.h"
+#include "transactionparser.h"
#include "database.h"
@@ -81,7 +81,7 @@ static void connection(TCPSocket &socket)
printf("Got connection...\n");
Transaction transaction;
- XMLParser parser(socket, transaction);
+ TransactionParser parser(socket, transaction);
parser.parse();
socket.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
diff --git a/server/src/xmlparser.cc b/server/src/transactionparser.cc
index 71bb753..9ca6288 100644
--- a/server/src/xmlparser.cc
+++ b/server/src/transactionparser.cc
@@ -1,6 +1,6 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/***************************************************************************
- * xmlparser.cc
+ * transactionparser.cc
*
* Fri Aug 31 09:30:06 CEST 2007
* Copyright 2007 Bent Bisballe Nyeng, Lars Bisballe Jensen and Peter Skaarup
@@ -24,7 +24,7 @@
* along with Pracro; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-#include "xmlparser.h"
+#include "transactionparser.h"
#include <stdio.h>
#include <string.h>
@@ -35,7 +35,14 @@
static bool done = false;
-void XMLParser::startTag(std::string name, std::map< std::string, std::string> attributes)
+TransactionParser::TransactionParser(TCPSocket &socket, Transaction &transaction)
+{
+ this->transaction = &transaction;
+ this->socket = &socket;
+ done = false;
+}
+
+void TransactionParser::startTag(std::string name, std::map< std::string, std::string> attributes)
{
if(name == "pracro") {
transaction->user = attributes["user"];
@@ -61,20 +68,13 @@ void XMLParser::startTag(std::string name, std::map< std::string, std::string> a
}
}
-void XMLParser::endTag(std::string name)
+void TransactionParser::endTag(std::string name)
{
if(name == "pracro") done = true;
}
-int XMLParser::readData(char *data, size_t size)
+int TransactionParser::readData(char *data, size_t size)
{
if(done) return 0;
return socket->read(data, size);
}
-
-XMLParser::XMLParser(TCPSocket &socket, Transaction &transaction)
-{
- this->transaction = &transaction;
- this->socket = &socket;
- done = false;
-}
diff --git a/server/src/xmlparser.h b/server/src/transactionparser.h
index 1a37e26..9528e47 100644
--- a/server/src/xmlparser.h
+++ b/server/src/transactionparser.h
@@ -1,6 +1,6 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/***************************************************************************
- * xmlparser.h
+ * transactionparser.h
*
* Fri Aug 31 09:30:06 CEST 2007
* Copyright 2007 Bent Bisballe Nyeng, Lars Bisballe Jensen and Peter Skaarup
@@ -24,16 +24,16 @@
* along with Pracro; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-#ifndef __PRACRO_XMLPARSER_H__
-#define __PRACRO_XMLPARSER_H__
+#ifndef __PRACRO_TRANSACTIONPARSER_H__
+#define __PRACRO_TRANSACTIONPARSER_H__
#include "saxparser.h"
#include "tcpsocket.h"
#include "transaction.h"
-class XMLParser : public SAXParser {
+class TransactionParser : public SAXParser {
public:
- XMLParser(TCPSocket &socket, Transaction &transaction);
+ TransactionParser(TCPSocket &socket, Transaction &transaction);
void startTag(std::string name, std::map< std::string, std::string> attributes);
void endTag(std::string name);
@@ -47,4 +47,4 @@ private:
bool done;
};
-#endif/*__PRACRO_XMLPARSER_H__*/
+#endif/*__PRACRO_TRANSACTIONPARSER_H__*/