1
0
forked from 0ad/0ad

CVFSInputSource clean-up, added headers to adts.{h,cpp}

This was SVN commit r3472.
This commit is contained in:
Simon Brenner 2006-02-04 22:44:52 +00:00
parent 7bf48e95c4
commit 92fb5450bc
4 changed files with 6 additions and 16 deletions

View File

@ -1,7 +1,7 @@
#include "precompiled.h"
#include "adts.h"
#include <deque>
//-----------------------------------------------------------------------------
// built-in self test

View File

@ -3,6 +3,7 @@
#include "lib.h"
#include <cfloat>
#include <cassert>
#include <list>

View File

@ -76,21 +76,21 @@ class CVFSInputSource: public InputSource
FileIOBuf m_pBuffer;
size_t m_BufferSize;
CVFSInputSource(const CVFSInputSource &);
CVFSInputSource &operator = (const CVFSInputSource &);
public:
CVFSInputSource():
m_pBuffer(NULL),
m_BufferSize(0)
{}
~CVFSInputSource();
virtual ~CVFSInputSource();
// Open a VFS path for XML parsing
// returns 0 if successful, -1 on failure
int OpenFile(const char *path, uint flags);
// Allow the use of externally-loaded files
void OpenBuffer(const char* path, const void* buffer, const size_t buffersize);
virtual BinInputStream *makeStream() const;
};

View File

@ -65,17 +65,6 @@ int CVFSInputSource::OpenFile(const char *path, uint flags = 0)
return 0;
}
void CVFSInputSource::OpenBuffer(const char* path, const void* buffer, const size_t buffersize)
{
debug_warn("who guarantees that buffer isn't already freed?");
m_pBuffer = (FileIOBuf)buffer;
m_BufferSize = buffersize;
XMLCh *sysId=XMLString::transcode(path);
setSystemId(sysId);
XMLString::release(&sysId);
}
CVFSInputSource::~CVFSInputSource()
{
// our buffer was vfs_load-ed; free it now