32 #ifndef MemoryFile_INCLUDE_ONCE 33 #define MemoryFile_INCLUDE_ONCE 70 unsigned char*
ptr() {
return mBuffer->ptr(); }
73 virtual bool exists()
const {
return true; }
77 virtual bool isOpen()
const {
return mIsOpen; }
79 virtual void close() { mPtr = 0; mIsOpen =
false; }
81 void allocateBuffer(
long long byte_count) { mBuffer->resize((
int)byte_count); }
83 virtual long long size()
const {
return mBuffer->bytesUsed(); }
93 virtual long long position_Implementation()
const;
95 virtual long long read_Implementation(
void* buffer,
long long byte_count);
99 virtual bool seekSet_Implementation(
long long offset);
virtual bool isOpen() const
Returns true if the file has been opened.
An abstract class representing a file.
Implements a buffer whose storage is in local memory.
virtual bool exists() const
A MemoryFile always exists.
virtual long long size() const
Returns the size of the file in bytes.
#define VL_INSTRUMENT_CLASS(ClassName, BaseClass)
Visualization Library main namespace.
MemoryFile & operator=(const MemoryFile &other)
A VirtualFile to manipulate files stored in memory.
const Buffer * buffer() const
void allocateBuffer(long long byte_count)
The ref<> class is used to reference-count an Object.
virtual long long write_Implementation(const void *, long long)
void setBuffer(Buffer *buffer)
This is useful when you want to point more MemoryFiles to the same Buffer object. ...
virtual void close()
Closes the file.