51 Log::error(
"MemoryFile::open(): file already open.\n");
88 byte_count = byte_count < bytes_left ? byte_count : bytes_left;
89 memcpy(buffer,
ptr() +
mPtr, (
size_t)byte_count);
106 if (
mPtr > static_cast<long long>(
mBuffer->bytesUsed()))
114 file->operator=(*this);
long long read(void *buffer, long long byte_count)
Reads byte_count bytes from a file. Returns the number of bytes actually read.
virtual bool isOpen() const
Returns true if the file has been opened.
An abstract class representing a file.
virtual bool isOpen() const =0
Returns true if the file has been opened.
static void error(const String &message)
Use this function to provide information about run-time errors: file not found, out of memory...
Implements a buffer whose storage is in local memory.
virtual long long size() const
Returns the size of the file in bytes.
virtual void close()=0
Closes the file.
Visualization Library main namespace.
virtual long long position_Implementation() const
ref< VirtualFile > clone() const
Creates a clone of this class instance.
virtual bool open(EOpenMode mode)=0
Opens the file in the specified mode.
const Buffer * buffer() const
virtual long long size() const =0
Returns the size of the file in bytes.
void allocateBuffer(long long byte_count)
virtual bool open(EOpenMode mode)
Opens the file in the specified mode.
The ref<> class is used to reference-count an Object.
virtual long long read_Implementation(void *buffer, long long byte_count)
void copy(VirtualFile *file)
Copies the data of any kind of VirtualFile.
virtual bool seekSet_Implementation(long long offset)