Visualization Library v1.0.3A lightweight C++ OpenGL middleware for 2D/3D graphics |
[Download] [Tutorials] [All Classes] [Grouped Classes] |
A VirtualFile that operates on regular disk files. More...
#include <DiskFile.hpp>
Public Member Functions | |
DiskFile (const String &path=String()) | |
~DiskFile () | |
bool | open (const String &path, EOpenMode mode) |
The specified path is relative to the parent directory. See setPhysicalPath(). | |
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. | |
virtual long long | size () const |
Returns the file size in bytes or -1 on error. | |
virtual bool | exists () const |
Returns true if the file exists. | |
DiskFile & | operator= (const DiskFile &other) |
virtual ref< VirtualFile > | clone () const |
Creates a clone of this class instance. | |
Protected Member Functions | |
DiskFile (const DiskFile &other) | |
virtual long long | read_Implementation (void *buffer, long long byte_count) |
virtual long long | write_Implementation (const void *buffer, long long byte_count) |
virtual long long | position_Implementation () const |
virtual bool | seekSet_Implementation (long long offset) |
ref< DiskDirectory > | parentDir () const |
Protected Attributes | |
FILE * | mHandle |
Friends | |
class | DiskDirectory |
A VirtualFile that operates on regular disk files.
Definition at line 63 of file DiskFile.hpp.
vl::DiskFile::DiskFile | ( | const DiskFile & | other ) | [inline, protected] |
Definition at line 69 of file DiskFile.hpp.
Referenced by clone().
Definition at line 44 of file DiskFile.cpp.
References mHandle, NULL, and vl::VirtualFile::setPath().
DiskFile::~DiskFile | ( | ) |
Definition at line 50 of file DiskFile.cpp.
References close().
The specified path is relative to the parent directory. See setPhysicalPath().
Definition at line 55 of file DiskFile.cpp.
References vl::VirtualFile::setPath().
bool DiskFile::open | ( | EOpenMode | mode ) | [virtual] |
Opens the file in the specified mode.
Implements vl::VirtualFile.
Definition at line 61 of file DiskFile.cpp.
References vl::Log::error(), isOpen(), mHandle, NULL, vl::OM_ReadOnly, vl::OM_WriteOnly, vl::VirtualFile::path(), and vl::String::toUTF8().
bool DiskFile::isOpen | ( | ) | const [virtual] |
Returns true
if the file has been opened.
Implements vl::VirtualFile.
Definition at line 105 of file DiskFile.cpp.
Referenced by open().
void DiskFile::close | ( | ) | [virtual] |
Closes the file.
Implements vl::VirtualFile.
Definition at line 110 of file DiskFile.cpp.
Referenced by ~DiskFile().
long long DiskFile::size | ( | ) | const [virtual] |
Returns the file size in bytes or -1 on error.
Implements vl::VirtualFile.
Definition at line 123 of file DiskFile.cpp.
References vl::Log::error(), mHandle, NULL, vl::VirtualFile::path(), and vl::String::toUTF8().
Referenced by read_Implementation().
bool DiskFile::exists | ( | ) | const [virtual] |
Returns true
if the file exists.
Implements vl::VirtualFile.
Definition at line 172 of file DiskFile.cpp.
References NULL, vl::VirtualFile::path(), and vl::String::toUTF8().
Definition at line 90 of file DiskFile.hpp.
ref< VirtualFile > DiskFile::clone | ( | ) | const [virtual] |
Creates a clone of this class instance.
Implements vl::VirtualFile.
Definition at line 324 of file DiskFile.cpp.
References DiskFile().
long long DiskFile::read_Implementation | ( | void * | buffer, |
long long | byte_count | ||
) | [protected, virtual] |
Implements vl::VirtualFile.
Definition at line 212 of file DiskFile.cpp.
References vl::Log::error(), mHandle, NULL, and size().
long long DiskFile::write_Implementation | ( | const void * | buffer, |
long long | byte_count | ||
) | [protected, virtual] |
Implements vl::VirtualFile.
Definition at line 256 of file DiskFile.cpp.
References vl::Log::error(), mHandle, and NULL.
long long DiskFile::position_Implementation | ( | ) | const [protected, virtual] |
Implements vl::VirtualFile.
Definition at line 277 of file DiskFile.cpp.
References vl::Log::error(), mHandle, and vl::VirtualFile::position().
bool DiskFile::seekSet_Implementation | ( | long long | offset ) | [protected, virtual] |
Implements vl::VirtualFile.
Definition at line 299 of file DiskFile.cpp.
References vl::Log::error(), mHandle, and vl::VirtualFile::position().
ref<DiskDirectory> vl::DiskFile::parentDir | ( | ) | const [protected] |
friend class DiskDirectory [friend] |
Definition at line 67 of file DiskFile.hpp.
FILE* vl::DiskFile::mHandle [protected] |
Definition at line 109 of file DiskFile.hpp.
Referenced by close(), DiskFile(), isOpen(), open(), position_Implementation(), read_Implementation(), seekSet_Implementation(), size(), and write_Implementation().