From f4c20290509d7ed3a8fd5304577e7a4cc0b9d974 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Tue, 3 Apr 2007 03:49:53 +0000 Subject: Ok, no code is left in src, it's all in src/old. We'll gradually move code back into src as it's fixed and re-org'd. This includes tests, which, I may write a unit test system into libbu++ just to make my life easier. --- src/xmlfilereader.cpp | 58 --------------------------------------------------- 1 file changed, 58 deletions(-) delete mode 100644 src/xmlfilereader.cpp (limited to 'src/xmlfilereader.cpp') diff --git a/src/xmlfilereader.cpp b/src/xmlfilereader.cpp deleted file mode 100644 index ed674a8..0000000 --- a/src/xmlfilereader.cpp +++ /dev/null @@ -1,58 +0,0 @@ -#include "xmlfilereader.h" -#include "exceptions.h" -#include - -XmlFileReader::XmlFileReader( const char *sFile, bool bStrip ) - : XmlReader( bStrip ) -{ - fh = fopen( sFile, "rt" ); - - if( fh == NULL ) - { - throw XmlException("Couldn't open file: %s", sFile ); - //nError = 1; - } - else - { - buildDoc(); - } -} - -XmlFileReader::~XmlFileReader() -{ -} - -char XmlFileReader::getChar( int nIndex ) -{ - // Make sure we always have a little data left in the buffer - if( fbDataIn.getLength() <= nIndex+1 && fh ) - { - int nBytes = fbDataIn.getCapacity()-1; - char *buf = new char[nBytes]; - int nRead = fread( buf, 1, nBytes, fh ); - fbDataIn.appendData( buf, nRead ); - delete[] buf; - - if( nRead < nBytes ) - { - fclose( fh ); - fh = NULL; - } - } - if( fbDataIn.getLength() >= nIndex+1 ) - { - return fbDataIn.getData()[nIndex]; - } - else - { - throw XmlException("End of XML stream read."); - } -} - -void XmlFileReader::usedChar( int nAmnt ) -{ - if( fbDataIn.getLength()-nAmnt >= 0 ) - { - fbDataIn.usedData( nAmnt ); - } -} -- cgit v1.2.3