#ifndef __C_MEMORY_READ_FILE_H_INCLUDED__
#define __C_MEMORY_READ_FILE_H_INCLUDED__
#include "IReadFile.h"
#include "IWriteFile.h"
#include "irrString.h"
namespace irr
{
namespace io
{
class CMemoryFile : public IReadFile, public IWriteFile
{
public:
CMemoryFile(void* memory, long len, const io::path& fileName, bool deleteMemoryWhenDropped);
virtual ~CMemoryFile();
virtual s32 read(void* buffer, u32 sizeToRead);
virtual s32 write(const void* buffer, u32 sizeToWrite);
virtual bool seek(long finalPos, bool relativeMovement = false);
virtual long getSize() const;
virtual long getPos() const;
virtual const io::path& getFileName() const;
private:
void *Buffer;
long Len;
long Pos;
io::path Filename;
bool deleteMemoryWhenDropped;
};
}
}
#endif