Visualization Library v1.0.3A lightweight C++ OpenGL middleware for 2D/3D graphics |
[Download] [Tutorials] [All Classes] [Grouped Classes] |
A VirtualFile to manipulate files stored in memory. More...
#include <MemoryFile.hpp>
Public Member Functions | |
MemoryFile () | |
const Buffer * | buffer () const |
Buffer * | buffer () |
void | setBuffer (Buffer *buffer) |
This is useful when you want to point more MemoryFiles to the same Buffer object. | |
unsigned char * | ptr () |
virtual bool | exists () const |
A MemoryFile always exists. | |
virtual bool | open (EOpenMode mode) |
Opens the file in the specified mode. | |
virtual bool | isOpen () const |
Returns true if the file has been opened. | |
virtual void | close () |
Closes the file. | |
void | allocateBuffer (long long byte_count) |
virtual long long | size () const |
Returns the size of the file in bytes. | |
void | copy (VirtualFile *file) |
Copies the data of any kind of VirtualFile. | |
MemoryFile & | operator= (const MemoryFile &other) |
ref< VirtualFile > | clone () const |
Creates a clone of this class instance. | |
Protected Member Functions | |
virtual long long | position_Implementation () const |
virtual long long | read_Implementation (void *buffer, long long byte_count) |
virtual long long | write_Implementation (const void *, long long) |
virtual bool | seekSet_Implementation (long long offset) |
Protected Attributes | |
ref< Buffer > | mBuffer |
long long | mPtr |
bool | mIsOpen |
A VirtualFile to manipulate files stored in memory.
Definition at line 56 of file MemoryFile.hpp.
MemoryFile::MemoryFile | ( | ) |
const Buffer* vl::MemoryFile::buffer | ( | ) | const [inline] |
Definition at line 63 of file MemoryFile.hpp.
Buffer* vl::MemoryFile::buffer | ( | ) | [inline] |
Definition at line 65 of file MemoryFile.hpp.
void vl::MemoryFile::setBuffer | ( | Buffer * | buffer ) | [inline] |
This is useful when you want to point more MemoryFiles to the same Buffer object.
Definition at line 68 of file MemoryFile.hpp.
unsigned char* vl::MemoryFile::ptr | ( | ) | [inline] |
Definition at line 70 of file MemoryFile.hpp.
Referenced by copy(), and read_Implementation().
virtual bool vl::MemoryFile::exists | ( | ) | const [inline, virtual] |
A MemoryFile always exists.
Implements vl::VirtualFile.
Definition at line 73 of file MemoryFile.hpp.
bool MemoryFile::open | ( | EOpenMode | mode ) | [virtual] |
Opens the file in the specified mode.
Implements vl::VirtualFile.
Definition at line 47 of file MemoryFile.cpp.
References vl::Log::error(), isOpen(), mIsOpen, and vl::OM_ReadOnly.
virtual bool vl::MemoryFile::isOpen | ( | ) | const [inline, virtual] |
Returns true
if the file has been opened.
Implements vl::VirtualFile.
Definition at line 77 of file MemoryFile.hpp.
Referenced by open(), position_Implementation(), read_Implementation(), and seekSet_Implementation().
virtual void vl::MemoryFile::close | ( | ) | [inline, virtual] |
void vl::MemoryFile::allocateBuffer | ( | long long | byte_count ) | [inline] |
Definition at line 81 of file MemoryFile.hpp.
Referenced by copy().
virtual long long vl::MemoryFile::size | ( | ) | const [inline, virtual] |
Returns the size of the file in bytes.
Implements vl::VirtualFile.
Definition at line 83 of file MemoryFile.hpp.
Referenced by copy().
void MemoryFile::copy | ( | VirtualFile * | file ) |
Copies the data of any kind of VirtualFile.
Definition at line 60 of file MemoryFile.cpp.
References allocateBuffer(), vl::VirtualFile::close(), vl::VirtualFile::isOpen(), vl::OM_ReadOnly, vl::VirtualFile::open(), ptr(), vl::VirtualFile::read(), size(), and vl::VirtualFile::size().
MemoryFile& vl::MemoryFile::operator= | ( | const MemoryFile & | other ) | [inline] |
Definition at line 88 of file MemoryFile.hpp.
References mBuffer.
ref< VirtualFile > MemoryFile::clone | ( | ) | const [virtual] |
Creates a clone of this class instance.
Implements vl::VirtualFile.
Definition at line 111 of file MemoryFile.cpp.
References MemoryFile().
long long MemoryFile::position_Implementation | ( | ) | const [protected, virtual] |
Implements vl::VirtualFile.
Definition at line 74 of file MemoryFile.cpp.
long long MemoryFile::read_Implementation | ( | void * | buffer, |
long long | byte_count | ||
) | [protected, virtual] |
Implements vl::VirtualFile.
Definition at line 81 of file MemoryFile.cpp.
virtual long long vl::MemoryFile::write_Implementation | ( | const void * | , |
long long | |||
) | [inline, protected, virtual] |
Implements vl::VirtualFile.
Definition at line 97 of file MemoryFile.hpp.
bool MemoryFile::seekSet_Implementation | ( | long long | offset ) | [protected, virtual] |
Implements vl::VirtualFile.
Definition at line 100 of file MemoryFile.cpp.
ref<Buffer> vl::MemoryFile::mBuffer [protected] |
Definition at line 102 of file MemoryFile.hpp.
Referenced by MemoryFile(), operator=(), read_Implementation(), and seekSet_Implementation().
long long vl::MemoryFile::mPtr [protected] |
Definition at line 103 of file MemoryFile.hpp.
Referenced by MemoryFile(), position_Implementation(), read_Implementation(), and seekSet_Implementation().
bool vl::MemoryFile::mIsOpen [protected] |
Definition at line 104 of file MemoryFile.hpp.
Referenced by MemoryFile(), and open().