aboutsummaryrefslogtreecommitdiff
path: root/src/old/xmlfilereader.cpp
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2009-02-11 05:29:41 +0000
committerMike Buland <eichlan@xagasoft.com>2009-02-11 05:29:41 +0000
commitf4b191f0ea396b58465bfba40749977780a3af58 (patch)
tree891490e91ab3b67524be67b2b71c85d84fd2f92a /src/old/xmlfilereader.cpp
parent292ae9453e7fdb2f1023ed9dfc99cbcd751f8b90 (diff)
downloadlibbu++-f4b191f0ea396b58465bfba40749977780a3af58.tar.gz
libbu++-f4b191f0ea396b58465bfba40749977780a3af58.tar.bz2
libbu++-f4b191f0ea396b58465bfba40749977780a3af58.tar.xz
libbu++-f4b191f0ea396b58465bfba40749977780a3af58.zip
Just removing some things that are cluttering up the source tree.
Diffstat (limited to '')
-rw-r--r--src/old/xmlfilereader.cpp58
1 files changed, 0 insertions, 58 deletions
diff --git a/src/old/xmlfilereader.cpp b/src/old/xmlfilereader.cpp
deleted file mode 100644
index ed674a8..0000000
--- a/src/old/xmlfilereader.cpp
+++ /dev/null
@@ -1,58 +0,0 @@
1#include "xmlfilereader.h"
2#include "exceptions.h"
3#include <string.h>
4
5XmlFileReader::XmlFileReader( const char *sFile, bool bStrip )
6 : XmlReader( bStrip )
7{
8 fh = fopen( sFile, "rt" );
9
10 if( fh == NULL )
11 {
12 throw XmlException("Couldn't open file: %s", sFile );
13 //nError = 1;
14 }
15 else
16 {
17 buildDoc();
18 }
19}
20
21XmlFileReader::~XmlFileReader()
22{
23}
24
25char XmlFileReader::getChar( int nIndex )
26{
27 // Make sure we always have a little data left in the buffer
28 if( fbDataIn.getLength() <= nIndex+1 && fh )
29 {
30 int nBytes = fbDataIn.getCapacity()-1;
31 char *buf = new char[nBytes];
32 int nRead = fread( buf, 1, nBytes, fh );
33 fbDataIn.appendData( buf, nRead );
34 delete[] buf;
35
36 if( nRead < nBytes )
37 {
38 fclose( fh );
39 fh = NULL;
40 }
41 }
42 if( fbDataIn.getLength() >= nIndex+1 )
43 {
44 return fbDataIn.getData()[nIndex];
45 }
46 else
47 {
48 throw XmlException("End of XML stream read.");
49 }
50}
51
52void XmlFileReader::usedChar( int nAmnt )
53{
54 if( fbDataIn.getLength()-nAmnt >= 0 )
55 {
56 fbDataIn.usedData( nAmnt );
57 }
58}