Visualization Library 2.0.0
A lightweight C++ OpenGL middleware for 2D/3D graphics
|
[Download] [Tutorials] [All Classes] [Grouped Classes] |
An abstract class representing a file. More...
#include <VirtualFile.hpp>
Public Member Functions | |
VirtualFile () | |
Constructor. More... | |
unsigned int | crc32 () |
Computes the crc32 of the entire file. More... | |
MD5CheckSum | md5 () |
Computes the md5 of the entire file. More... | |
virtual bool | open (EOpenMode mode)=0 |
Opens the file in the specified mode. More... | |
virtual bool | isOpen () const =0 |
Returns true if the file has been opened. More... | |
virtual bool | exists () const =0 |
Returns true if the file exists. More... | |
virtual void | close ()=0 |
Closes the file. More... | |
virtual long long | size () const =0 |
Returns the size of the file in bytes. More... | |
virtual ref< VirtualFile > | clone () const =0 |
Creates a clone of this class instance. More... | |
VirtualFile & | operator= (const VirtualFile &other) |
const String & | path () const |
Returns the path of the file. More... | |
void | setPath (const String &name) |
Changes the path bound to a VirtualFile. Use carefully this function, you shouldn't rename a VirtualFile managed by a VirtualDirectory. More... | |
long long | peek (void *buffer, long long byte_count) |
Reads byte_count bytes and returns to the original position. More... | |
long long | read (void *buffer, long long byte_count) |
Reads byte_count bytes from a file. Returns the number of bytes actually read. More... | |
long long | write (const void *buffer, long long byte_count) |
Writes byte_count bytes to a file. Returns the number of bytes actually written. More... | |
long long | position () const |
Returns the current position in the file. More... | |
bool | seekSet (long long offset) |
Changes the current read/write position of a file. More... | |
bool | seekCur (long long offset) |
Changes the current read/write position of a file. More... | |
bool | seekEnd (long long offset) |
Changes the current read/write position of a file. More... | |
bool | endOfFile () const |
Returns true if position() >= size() More... | |
long long | load (std::vector< char > &data) |
Loads the entire file in the specified vector. More... | |
long long | load (void *buffer, long long max=-1) |
Loads the entire file in the specified buffer. More... | |
double | readDouble (bool little_endian_data=true) |
Reads single entry. More... | |
float | readFloat (bool little_endian_data=true) |
Reads single entry. More... | |
unsigned long long | readUInt64 (bool little_endian_data=true) |
Reads single entry. More... | |
long long | readSInt64 (bool little_endian_data=true) |
Reads single entry. More... | |
unsigned int | readUInt32 (bool little_endian_data=true) |
Reads single entry. More... | |
int | readSInt32 (bool little_endian_data=true) |
Reads single entry. More... | |
unsigned short | readUInt16 (bool little_endian_data=true) |
Reads single entry. More... | |
short | readSInt16 (bool little_endian_data=true) |
Reads single entry. More... | |
unsigned char | readUInt8 () |
Reads single entry. More... | |
char | readSInt8 () |
Reads single entry. More... | |
long long | readDouble (double *buffer, long long count, bool little_endian_data=true) |
Reads multiple entries. Returns the number of bytes read. More... | |
long long | readFloat (float *buffer, long long count, bool little_endian_data=true) |
Reads multiple entries. Returns the number of bytes read. More... | |
long long | readUInt64 (unsigned long long *buffer, long long count, bool little_endian_data=true) |
Reads multiple entries. Returns the number of bytes read. More... | |
long long | readSInt64 (long long *buffer, long long count, bool little_endian_data=true) |
Reads multiple entries. Returns the number of bytes read. More... | |
long long | readUInt32 (unsigned int *buffer, long long count, bool little_endian_data=true) |
Reads multiple entries. Returns the number of bytes read. More... | |
long long | readSInt32 (int *buffer, long long count, bool little_endian_data=true) |
Reads multiple entries. Returns the number of bytes read. More... | |
long long | readUInt16 (unsigned short *buffer, long long count, bool little_endian_data=true) |
Reads multiple entries. Returns the number of bytes read. More... | |
long long | readSInt16 (short *buffer, long long count, bool little_endian_data=true) |
Reads multiple entries. Returns the number of bytes read. More... | |
long long | readUInt8 (unsigned char *buffer, long long count) |
Reads multiple entries. Returns the number of bytes read. More... | |
long long | readSInt8 (char *buffer, long long count) |
Reads multiple entries. Returns the number of bytes read. More... | |
long long | writeDouble (double data, bool little_endian_data=true) |
Writes a single entry. Returns the number of bytes written. More... | |
long long | writeFloat (float data, bool little_endian_data=true) |
Writes a single entry. Returns the number of bytes written. More... | |
long long | writeUInt64 (unsigned long long data, bool little_endian_data=true) |
Writes a single entry. Returns the number of bytes written. More... | |
long long | writeSInt64 (long long data, bool little_endian_data=true) |
Writes a single entry. Returns the number of bytes written. More... | |
long long | writeUInt32 (unsigned int data, bool little_endian_data=true) |
Writes a single entry. Returns the number of bytes written. More... | |
long long | writeSInt32 (int data, bool little_endian_data=true) |
Writes a single entry. Returns the number of bytes written. More... | |
long long | writeUInt16 (unsigned short data, bool little_endian_data=true) |
Writes a single entry. Returns the number of bytes written. More... | |
long long | writeSInt16 (short data, bool little_endian_data=true) |
Writes a single entry. Returns the number of bytes written. More... | |
long long | writeUInt8 (unsigned char data) |
Writes a single entry. Returns the number of bytes written. More... | |
long long | writeSInt8 (char data) |
Writes a single entry. Returns the number of bytes written. More... | |
long long | writeDouble (const double *buffer, long long count, bool little_endian_data=true) |
Writes multiple entries. Returns the number of bytes written. More... | |
long long | writeFloat (const float *buffer, long long count, bool little_endian_data=true) |
Writes multiple entries. Returns the number of bytes written. More... | |
long long | writeUInt64 (const unsigned long long *buffer, long long count, bool little_endian_data=true) |
Writes multiple entries. Returns the number of bytes written. More... | |
long long | writeSInt64 (const long long *buffer, long long count, bool little_endian_data=true) |
Writes multiple entries. Returns the number of bytes written. More... | |
long long | writeUInt32 (const unsigned int *buffer, long long count, bool little_endian_data=true) |
Writes multiple entries. Returns the number of bytes written. More... | |
long long | writeSInt32 (const int *buffer, long long count, bool little_endian_data=true) |
Writes multiple entries. Returns the number of bytes written. More... | |
long long | writeUInt16 (const unsigned short *buffer, long long count, bool little_endian_data=true) |
Writes multiple entries. Returns the number of bytes written. More... | |
long long | writeSInt16 (const short *buffer, long long count, bool little_endian_data=true) |
Writes multiple entries. Returns the number of bytes written. More... | |
long long | writeUInt8 (const unsigned char *buffer, long long count) |
Writes multiple entries. Returns the number of bytes written. More... | |
long long | writeSInt8 (const char *buffer, long long count) |
Writes multiple entries. Returns the number of bytes written. More... | |
Public Member Functions inherited from vl::Object | |
Object () | |
Constructor. More... | |
Object (const Object &other) | |
Copy constructor: copies the name, ref count mutex and user data. More... | |
Object & | operator= (const Object &other) |
Copy operator: copies the object's name, ref count mutex and user data. More... | |
const std::string & | objectName () const |
The name of the object, by default set to the object's class name. More... | |
void | setObjectName (const char *name) |
The name of the object, by default set to the object's class name in debug builds. More... | |
void | setObjectName (const std::string &name) |
The name of the object, by default set to the object's class name in debug builds. More... | |
void | setRefCountMutex (IMutex *mutex) |
The mutex used to protect the reference counting of an Object across multiple threads. More... | |
IMutex * | refCountMutex () |
The mutex used to protect the reference counting of an Object across multiple threads. More... | |
const IMutex * | refCountMutex () const |
The mutex used to protect the reference counting of an Object across multiple threads. More... | |
int | referenceCount () const |
Returns the number of references of an object. More... | |
void | incReference () const |
Increments the reference count of an object. More... | |
void | decReference () |
Decrements the reference count of an object and deletes it if both automaticDelete() is true the count reaches 0. More... | |
void | setAutomaticDelete (bool autodel_on) |
If set to true the Object is deleted when its reference count reaches 0. More... | |
bool | automaticDelete () const |
If set to true the Object is deleted when its reference count reaches 0. More... | |
template<class T > | |
T * | as () |
Casts an Object to the specified class. More... | |
template<class T > | |
const T * | as () const |
Casts an Object to the specified class. More... | |
Protected Member Functions | |
VirtualFile (const VirtualFile &other) | |
virtual long long | read_Implementation (void *buffer, long long byte_count)=0 |
virtual long long | write_Implementation (const void *buffer, long long byte_count)=0 |
virtual long long | position_Implementation () const =0 |
virtual bool | seekSet_Implementation (long long offset)=0 |
long long | write64 (const void *buffer, long long count, bool little_endian_data=true) |
long long | write32 (const void *buffer, long long count, bool little_endian_data=true) |
long long | write16 (const void *buffer, long long count, bool little_endian_data=true) |
long long | read64 (void *buffer, long long count, bool little_endian_data=true) |
long long | read32 (void *buffer, long long count, bool little_endian_data=true) |
long long | read16 (void *buffer, long long count, bool little_endian_data=true) |
long long | write64 (const void *buffer, bool little_endian_data=true) |
long long | write32 (const void *buffer, bool little_endian_data=true) |
long long | write16 (const void *buffer, bool little_endian_data=true) |
long long | read64 (void *buffer, bool little_endian_data=true) |
long long | read32 (void *buffer, bool little_endian_data=true) |
long long | read16 (void *buffer, bool little_endian_data=true) |
Protected Member Functions inherited from vl::Object | |
virtual | ~Object () |
Protected Attributes | |
String | mPath |
Protected Attributes inherited from vl::Object | |
std::string | mObjectName |
IMutex * | mRefCountMutex |
int | mReferenceCount |
bool | mAutomaticDelete |
|
inlineprotected |
Definition at line 65 of file VirtualFile.hpp.
|
inline |
Constructor.
Definition at line 69 of file VirtualFile.hpp.
|
pure virtual |
Creates a clone of this class instance.
Implemented in vl::ZippedFile, vl::DiskFile, vl::QtFile, vl::QtFile, vl::MemoryFile, and vl::GZipCodec.
|
pure virtual |
Closes the file.
Implemented in vl::ZippedFile, vl::DiskFile, vl::QtFile, vl::QtFile, vl::MemoryFile, and vl::GZipCodec.
Referenced by vl::GZipCodec::close(), vl::ZippedFile::close(), vl::MemoryFile::copy(), crc32(), vl::ZippedFile::extract(), vl::ZippedDirectory::init(), vl::isBMP(), vl::isDAT(), vl::isDDS(), vl::isDICOM(), vl::isJPG(), vl::isPNG(), vl::isTGA(), vl::isTIFF(), vlX::isVLB(), vlX::isVLT(), load(), vl::loadBMP(), vl::loadDAT(), vl::loadDDS(), vl::loadDICOM(), vl::loadImage(), vl::loadJPG(), vl::loadMD2(), vl::loadMOL2(), vl::ObjLoader::loadOBJ(), vl::PlyLoader::loadPly(), vl::loadPNG(), vl::LoadWriterManager::loadResource(), vl::STLLoader::loadSTL(), vl::String::loadText(), vl::loadTGA(), vl::loadTIFF(), vlX::VLXSerializer::loadVLB(), vlX::VLXSerializer::loadVLT(), md5(), vl::ZippedFile::open(), vlX::ParserVLB::parse(), vl::A3DSLoader::parse3DS(), vl::saveDICOM(), vl::saveJPG(), vl::savePNG(), vl::saveTGA(), vl::saveTIFF(), vlX::VLXSerializer::saveVLB(), vlX::VLXSerializer::saveVLT(), vlX::VisitorExportToVLB::setOutputFile(), vl::GZipCodec::setStream(), and vl::GZipCodec::uncompressedSize().
unsigned int VirtualFile::crc32 | ( | ) |
Computes the crc32 of the entire file.
Definition at line 43 of file VirtualFile.cpp.
References close(), vl::CRC32CheckSum::compute(), vl::OM_ReadOnly, and open().
|
inline |
Returns true if position()
>= size()
Definition at line 126 of file VirtualFile.hpp.
References vl::max().
Referenced by vl::A3DSLoader::parse3DS().
|
pure virtual |
Returns true
if the file exists.
Implemented in vl::ZippedFile, vl::DiskFile, vl::QtFile, vl::QtFile, vl::MemoryFile, and vl::GZipCodec.
|
pure virtual |
Returns true
if the file has been opened.
Implemented in vl::ZippedFile, vl::DiskFile, vl::QtFile, vl::QtFile, vl::MemoryFile, and vl::GZipCodec.
Referenced by vl::MemoryFile::copy(), vl::ZippedFile::extract(), vl::loadImage(), vl::loadRAW(), and peek().
long long VirtualFile::load | ( | std::vector< char > & | data | ) |
Loads the entire file in the specified vector.
Returns the number of bytes read. The file must be closed before calling this function.
Definition at line 131 of file VirtualFile.cpp.
References size().
Referenced by vl::DaeLoader::load(), and vl::String::loadText().
long long VirtualFile::load | ( | void * | buffer, |
long long | max = -1 |
||
) |
Loads the entire file in the specified buffer.
Returns the number of bytes read. The file must be closed before calling this function.
Definition at line 140 of file VirtualFile.cpp.
References close(), vl::Log::error(), vl::OM_ReadOnly, open(), path(), read(), and size().
MD5CheckSum VirtualFile::md5 | ( | ) |
Computes the md5 of the entire file.
Definition at line 57 of file VirtualFile.cpp.
References close(), vl::MD5CheckSum::compute(), vl::OM_ReadOnly, and open().
|
pure virtual |
Opens the file in the specified mode.
Implemented in vl::ZippedFile, vl::DiskFile, vl::QtFile, vl::QtFile, vl::MemoryFile, and vl::GZipCodec.
Referenced by vl::MemoryFile::copy(), crc32(), vl::ZippedFile::extract(), vl::ZippedDirectory::init(), vl::isBMP(), vl::isDAT(), vl::isDDS(), vl::isDICOM(), vl::isJPG(), vl::isPNG(), vl::isTGA(), vl::isTIFF(), vlX::isVLB(), vlX::isVLT(), load(), vl::loadBMP(), vl::loadDAT(), vl::loadDDS(), vl::loadDICOM(), vl::loadJPG(), vl::loadMD2(), vl::loadMHD(), vl::ObjLoader::loadOBJ(), vl::loadPNG(), vl::loadRAW(), vl::LoadWriterManager::loadResource(), vl::STLLoader::loadSTL(), vl::loadTGA(), vl::loadTIFF(), md5(), vlX::ParserVLB::parse(), vl::A3DSLoader::parse3DS(), vl::saveDICOM(), vl::saveJPG(), vl::savePNG(), vl::saveTGA(), vl::saveTIFF(), vlX::VLXSerializer::saveVLT(), vlX::VisitorExportToVLB::setOutputFile(), and vl::GZipCodec::uncompressedSize().
|
inline |
Definition at line 95 of file VirtualFile.hpp.
References mPath.
|
inline |
Returns the path
of the file.
Definition at line 98 of file VirtualFile.hpp.
Referenced by vl::MemoryDirectory::addFile(), vl::LoadWriterManager::canLoad(), vl::LoadWriterManager::canWrite(), vl::MemoryDirectory::clone(), vl::QtFile::exists(), vl::DiskFile::exists(), vl::LoadWriterManager::findLoader(), vl::LoadWriterManager::findWriter(), vl::ZippedDirectory::init(), vl::isDAT(), vl::isDDS(), vl::isJPG(), vl::isMHD(), vl::isTGA(), vl::DaeLoader::load(), load(), vl::loadAC3D(), vl::loadBMP(), vl::loadDAT(), vl::loadDDS(), vl::loadDICOM(), vl::loadImage(), vl::loadJPG(), vl::loadMD2(), vl::loadMHD(), vl::loadMOL2(), vl::ObjLoader::loadOBJ(), vl::ObjLoader::loadObjMaterials(), vl::loadPNG(), vl::loadRAW(), vl::LoadWriterManager::loadResource(), vl::loadTGA(), vlX::VLXSerializer::loadVLB(), vlX::VLXSerializer::loadVLT(), vl::MemoryDirectory::memorySubDir(), vl::GZipCodec::open(), vl::QtFile::open(), vl::DiskFile::open(), vl::A3DSLoader::parse3DS(), vl::A3DSLoader::readMapChunk(), vl::MemoryDirectory::removeFile(), vl::saveImage(), vl::saveJPG(), vl::savePNG(), vl::saveTGA(), vl::saveTIFF(), vlX::VLXSerializer::saveVLT(), vl::GZipCodec::seekSet_Implementation(), vl::GZipCodec::setStream(), vl::QtFile::size(), vl::DiskFile::size(), vlX::LoadWriterVLX::writeResource(), vl::LoadWriterManager::writeResource(), and vl::ZippedDirectory::zippedSubDir().
long long VirtualFile::peek | ( | void * | buffer, |
long long | byte_count | ||
) |
Reads byte_count bytes and returns to the original position.
Returns the number of bytes read.
Definition at line 68 of file VirtualFile.cpp.
References vl::Log::error(), isOpen(), position(), read(), and seekSet().
long long VirtualFile::position | ( | ) | const |
Returns the current position in the file.
Definition at line 98 of file VirtualFile.cpp.
References position_Implementation().
Referenced by vl::GZipCodec::fillUncompressedBuffer(), vl::ZippedFile::fillUncompressedBuffer(), vl::ZippedDirectory::init(), vl::loadBMP(), peek(), vl::DiskFile::position_Implementation(), vl::A3DSLoader::read_3D_EDITOR_CHUNK(), vl::A3DSLoader::read_MATERIAL_BLOCK(), vl::A3DSLoader::read_OBJECT_BLOCK(), vl::A3DSLoader::read_TRIANGULAR_MESH(), vl::A3DSLoader::readColChunk(), vl::A3DSLoader::readMapChunk(), seekCur(), vl::DiskFile::seekSet_Implementation(), vl::GZipCodec::seekSet_Implementation(), vl::ZippedFile::seekSet_Implementation(), and vl::GZipCodec::uncompressedSize().
|
protectedpure virtual |
Implemented in vl::ZippedFile, vl::GZipCodec, vl::DiskFile, vl::QtFile, vl::QtFile, and vl::MemoryFile.
Referenced by position().
long long VirtualFile::read | ( | void * | buffer, |
long long | byte_count | ||
) |
Reads byte_count
bytes from a file. Returns the number of bytes actually read.
Definition at line 82 of file VirtualFile.cpp.
References read_Implementation().
Referenced by vl::MD5CheckSum::compute(), vl::CRC32CheckSum::compute(), vl::MemoryFile::copy(), vl::decompress(), vl::ZippedFile::extract(), vl::BufferedStream< char, 128 *1024 >::fillBuffer(), vl::GZipCodec::fillUncompressedBuffer(), vl::ZippedFile::fillUncompressedBuffer(), vl::ZippedDirectory::init(), vl::isBMP(), vl::isDDS(), vl::isDICOM(), vl::isJPG(), vl::isPNG(), vl::isTGA(), vl::isTIFF(), vlX::isVLB(), vlX::isVLT(), load(), vl::STLLoader::loadBinary(), vl::loadBMP(), vl::loadDDS(), vl::loadDICOM(), vl::loadMD2(), vl::loadPNG(), vl::loadRAW(), vl::LoadWriterManager::loadResource(), vl::STLLoader::loadSTL(), vl::loadTGA(), vlX::ParserVLB::parseHeader(), peek(), read16(), read32(), read64(), vl::ZippedFile::read_Implementation(), vl::A3DSLoader::read_TRIANGULAR_MESH(), vlX::ParserVLB::readChunk(), vlX::ParserVLB::readInteger(), readSInt8(), vlX::ParserVLB::readString(), readUInt8(), vlX::ParserVLB::readValue(), vl::GZipCodec::seekSet_Implementation(), and vl::ZippedFile::seekSet_Implementation().
|
protected |
Definition at line 470 of file VirtualFile.cpp.
References read().
Referenced by readSInt16(), and readUInt16().
|
protected |
Definition at line 563 of file VirtualFile.cpp.
References read().
|
protected |
Definition at line 452 of file VirtualFile.cpp.
References read().
Referenced by readFloat(), readSInt32(), and readUInt32().
|
protected |
Definition at line 548 of file VirtualFile.cpp.
References read().
|
protected |
Definition at line 432 of file VirtualFile.cpp.
References read().
Referenced by readDouble(), readSInt64(), and readUInt64().
|
protected |
Definition at line 531 of file VirtualFile.cpp.
References read().
|
protectedpure virtual |
Implemented in vl::ZippedFile, vl::GZipCodec, vl::DiskFile, vl::MemoryFile, vl::QtFile, and vl::QtFile.
Referenced by read().
double VirtualFile::readDouble | ( | bool | little_endian_data = true | ) |
Reads single entry.
Definition at line 159 of file VirtualFile.cpp.
References read64().
Referenced by vl::PlyLoader::PlyScalar::read(), and vlX::ParserVLB::readValue().
long long VirtualFile::readDouble | ( | double * | buffer, |
long long | count, | ||
bool | little_endian_data = true |
||
) |
Reads multiple entries. Returns the number of bytes read.
Definition at line 231 of file VirtualFile.cpp.
References read64().
float VirtualFile::readFloat | ( | bool | little_endian_data = true | ) |
Reads single entry.
Definition at line 166 of file VirtualFile.cpp.
References read32().
Referenced by vl::PlyLoader::PlyScalar::read(), vl::A3DSLoader::read_TRIANGULAR_MESH(), vl::A3DSLoader::readColFloat3(), vl::A3DSLoader::readFloatPercent(), vl::A3DSLoader::readMapChunk(), vlX::ParserVLB::readValue(), and vl::A3DSLoader::readVec3().
long long VirtualFile::readFloat | ( | float * | buffer, |
long long | count, | ||
bool | little_endian_data = true |
||
) |
Reads multiple entries. Returns the number of bytes read.
Definition at line 236 of file VirtualFile.cpp.
References read32().
short VirtualFile::readSInt16 | ( | bool | little_endian_data = true | ) |
Reads single entry.
Definition at line 208 of file VirtualFile.cpp.
References read16().
Referenced by vl::PlyLoader::PlyScalar::read().
long long VirtualFile::readSInt16 | ( | short * | buffer, |
long long | count, | ||
bool | little_endian_data = true |
||
) |
Reads multiple entries. Returns the number of bytes read.
Definition at line 266 of file VirtualFile.cpp.
References read16().
int VirtualFile::readSInt32 | ( | bool | little_endian_data = true | ) |
Reads single entry.
Definition at line 194 of file VirtualFile.cpp.
References read32().
Referenced by vl::PlyLoader::PlyScalar::read().
long long VirtualFile::readSInt32 | ( | int * | buffer, |
long long | count, | ||
bool | little_endian_data = true |
||
) |
Reads multiple entries. Returns the number of bytes read.
Definition at line 256 of file VirtualFile.cpp.
References read32().
long long VirtualFile::readSInt64 | ( | bool | little_endian_data = true | ) |
long long VirtualFile::readSInt64 | ( | long long * | buffer, |
long long | count, | ||
bool | little_endian_data = true |
||
) |
Reads multiple entries. Returns the number of bytes read.
Definition at line 246 of file VirtualFile.cpp.
References read64().
char VirtualFile::readSInt8 | ( | ) |
Reads single entry.
Definition at line 222 of file VirtualFile.cpp.
References read().
Referenced by vl::PlyLoader::PlyScalar::read().
long long VirtualFile::readSInt8 | ( | char * | buffer, |
long long | count | ||
) |
Reads multiple entries. Returns the number of bytes read.
Definition at line 276 of file VirtualFile.cpp.
References read().
unsigned short VirtualFile::readUInt16 | ( | bool | little_endian_data = true | ) |
Reads single entry.
Definition at line 201 of file VirtualFile.cpp.
References read16().
Referenced by vl::ZippedDirectory::init(), vl::isTIFF(), vl::PlyLoader::PlyScalar::read(), vl::A3DSLoader::read_TRIANGULAR_MESH(), vl::A3DSLoader::readChunk(), vl::A3DSLoader::readMapChunk(), and vl::A3DSLoader::readWordPercent().
long long VirtualFile::readUInt16 | ( | unsigned short * | buffer, |
long long | count, | ||
bool | little_endian_data = true |
||
) |
Reads multiple entries. Returns the number of bytes read.
Definition at line 261 of file VirtualFile.cpp.
References read16().
unsigned int VirtualFile::readUInt32 | ( | bool | little_endian_data = true | ) |
Reads single entry.
Definition at line 187 of file VirtualFile.cpp.
References read32().
Referenced by vl::ZippedDirectory::init(), vl::isDDS(), vl::STLLoader::loadBinary(), vl::A3DSLoader::parse3DS(), vl::PlyLoader::PlyScalar::read(), vl::A3DSLoader::read_TRIANGULAR_MESH(), vl::A3DSLoader::readChunk(), and vl::GZipCodec::uncompressedSize().
long long VirtualFile::readUInt32 | ( | unsigned int * | buffer, |
long long | count, | ||
bool | little_endian_data = true |
||
) |
Reads multiple entries. Returns the number of bytes read.
Definition at line 251 of file VirtualFile.cpp.
References read32().
unsigned long long VirtualFile::readUInt64 | ( | bool | little_endian_data = true | ) |
long long VirtualFile::readUInt64 | ( | unsigned long long * | buffer, |
long long | count, | ||
bool | little_endian_data = true |
||
) |
Reads multiple entries. Returns the number of bytes read.
Definition at line 241 of file VirtualFile.cpp.
References read64().
unsigned char VirtualFile::readUInt8 | ( | ) |
Reads single entry.
Definition at line 215 of file VirtualFile.cpp.
References read().
Referenced by vlX::ParserVLB::parseHeader(), vl::PlyLoader::PlyScalar::read(), vl::A3DSLoader::readColByte3(), vl::PlyLoader::readElements(), vl::A3DSLoader::readLine(), and vlX::ParserVLB::readValue().
long long VirtualFile::readUInt8 | ( | unsigned char * | buffer, |
long long | count | ||
) |
Reads multiple entries. Returns the number of bytes read.
Definition at line 271 of file VirtualFile.cpp.
References read().
bool VirtualFile::seekCur | ( | long long | offset | ) |
Changes the current read/write position of a file.
Definition at line 121 of file VirtualFile.cpp.
References position(), and seekSet().
Referenced by vl::ZippedDirectory::init(), and vl::A3DSLoader::skipChunk().
bool VirtualFile::seekEnd | ( | long long | offset | ) |
Changes the current read/write position of a file.
Definition at line 126 of file VirtualFile.cpp.
References seekSet(), and size().
Referenced by vl::isTGA(), and vl::GZipCodec::uncompressedSize().
bool VirtualFile::seekSet | ( | long long | offset | ) |
Changes the current read/write position of a file.
Definition at line 103 of file VirtualFile.cpp.
References vl::Log::error(), seekSet_Implementation(), and size().
Referenced by vl::ZippedFile::extract(), vl::isDICOM(), vl::loadBMP(), vl::loadMD2(), vl::loadRAW(), vl::STLLoader::loadSTL(), vl::loadTGA(), vl::ZippedFile::open(), peek(), vl::PlyLoader::readElements(), vl::BufferedStream< char, 128 *1024 >::seek(), seekCur(), seekEnd(), and vl::GZipCodec::uncompressedSize().
|
protectedpure virtual |
Implemented in vl::ZippedFile, vl::GZipCodec, vl::DiskFile, vl::QtFile, vl::QtFile, and vl::MemoryFile.
Referenced by seekSet().
|
inline |
Changes the path bound to a VirtualFile. Use carefully this function, you shouldn't rename a VirtualFile managed by a VirtualDirectory.
Definition at line 101 of file VirtualFile.hpp.
References vl::String::normalizeSlashes().
Referenced by vl::MemoryDirectory::addFile(), vl::MemoryDirectory::clone(), vl::DiskFile::DiskFile(), vl::GZipCodec::GZipCodec(), vl::ZippedDirectory::init(), vl::DiskDirectory::listFiles(), vl::QtDirectory::listFiles(), vl::LoadWriterManager::loadResource(), vl::QtFile::open(), vl::DiskFile::open(), vl::QtFile::QtFile(), and vl::GZipCodec::setStream().
|
pure virtual |
Returns the size of the file in bytes.
Implemented in vl::ZippedFile, vl::DiskFile, vl::QtFile, vl::QtFile, vl::MemoryFile, and vl::GZipCodec.
Referenced by vl::GZipCodec::compressedSize(), vl::MemoryFile::copy(), load(), vl::LoadWriterManager::loadResource(), vl::GZipCodec::open(), vl::A3DSLoader::read_3D_EDITOR_CHUNK(), vl::A3DSLoader::read_MATERIAL_BLOCK(), vl::A3DSLoader::read_OBJECT_BLOCK(), vl::A3DSLoader::read_TRIANGULAR_MESH(), vl::A3DSLoader::readColChunk(), vl::A3DSLoader::readMapChunk(), seekEnd(), and seekSet().
long long VirtualFile::write | ( | const void * | buffer, |
long long | byte_count | ||
) |
Writes byte_count
bytes to a file. Returns the number of bytes actually written.
Definition at line 90 of file VirtualFile.cpp.
References write_Implementation().
Referenced by vl::GZipCodec::close(), vl::saveDICOM(), vl::saveTGA(), vl::saveTIFF(), vlX::VLXSerializer::saveVLT(), vlX::VisitorExportToVLB::visitArray(), write16(), write32(), write64(), vl::GZipCodec::write_Implementation(), vlX::VisitorExportToVLB::writeHeader(), vlX::VisitorExportToVLB::writeInteger(), writeSInt8(), vlX::VisitorExportToVLB::writeString(), and writeUInt8().
|
protected |
Definition at line 417 of file VirtualFile.cpp.
References write().
Referenced by writeSInt16(), and writeUInt16().
|
protected |
Definition at line 518 of file VirtualFile.cpp.
References write().
|
protected |
Definition at line 402 of file VirtualFile.cpp.
References write().
Referenced by writeFloat(), writeSInt32(), and writeUInt32().
|
protected |
Definition at line 503 of file VirtualFile.cpp.
References write().
|
protected |
Definition at line 387 of file VirtualFile.cpp.
References write().
Referenced by writeDouble(), writeSInt64(), and writeUInt64().
|
protected |
Definition at line 486 of file VirtualFile.cpp.
References write().
|
protectedpure virtual |
Implemented in vl::ZippedFile, vl::GZipCodec, vl::DiskFile, vl::MemoryFile, vl::QtFile, and vl::QtFile.
Referenced by write().
long long VirtualFile::writeDouble | ( | double | data, |
bool | little_endian_data = true |
||
) |
Writes a single entry. Returns the number of bytes written.
Definition at line 283 of file VirtualFile.cpp.
References write64().
Referenced by vlX::VisitorExportToVLB::visitArray(), and vlX::VisitorExportToVLB::writeValue().
long long VirtualFile::writeDouble | ( | const double * | buffer, |
long long | count, | ||
bool | little_endian_data = true |
||
) |
Writes multiple entries. Returns the number of bytes written.
Definition at line 335 of file VirtualFile.cpp.
References write64().
long long VirtualFile::writeFloat | ( | float | data, |
bool | little_endian_data = true |
||
) |
Writes a single entry. Returns the number of bytes written.
Definition at line 288 of file VirtualFile.cpp.
References write32().
Referenced by vlX::VisitorExportToVLB::visitArray().
long long VirtualFile::writeFloat | ( | const float * | buffer, |
long long | count, | ||
bool | little_endian_data = true |
||
) |
Writes multiple entries. Returns the number of bytes written.
Definition at line 340 of file VirtualFile.cpp.
References write32().
long long VirtualFile::writeSInt16 | ( | short | data, |
bool | little_endian_data = true |
||
) |
Writes a single entry. Returns the number of bytes written.
Definition at line 318 of file VirtualFile.cpp.
References write16().
long long VirtualFile::writeSInt16 | ( | const short * | buffer, |
long long | count, | ||
bool | little_endian_data = true |
||
) |
Writes multiple entries. Returns the number of bytes written.
Definition at line 370 of file VirtualFile.cpp.
References write16().
long long VirtualFile::writeSInt32 | ( | int | data, |
bool | little_endian_data = true |
||
) |
Writes a single entry. Returns the number of bytes written.
Definition at line 308 of file VirtualFile.cpp.
References write32().
long long VirtualFile::writeSInt32 | ( | const int * | buffer, |
long long | count, | ||
bool | little_endian_data = true |
||
) |
Writes multiple entries. Returns the number of bytes written.
Definition at line 360 of file VirtualFile.cpp.
References write32().
long long VirtualFile::writeSInt64 | ( | long long | data, |
bool | little_endian_data = true |
||
) |
Writes a single entry. Returns the number of bytes written.
Definition at line 298 of file VirtualFile.cpp.
References write64().
Referenced by vlX::VisitorExportToVLB::writeInteger().
long long VirtualFile::writeSInt64 | ( | const long long * | buffer, |
long long | count, | ||
bool | little_endian_data = true |
||
) |
Writes multiple entries. Returns the number of bytes written.
Definition at line 350 of file VirtualFile.cpp.
References write64().
long long VirtualFile::writeSInt8 | ( | char | data | ) |
Writes a single entry. Returns the number of bytes written.
Definition at line 328 of file VirtualFile.cpp.
References write().
long long VirtualFile::writeSInt8 | ( | const char * | buffer, |
long long | count | ||
) |
Writes multiple entries. Returns the number of bytes written.
Definition at line 380 of file VirtualFile.cpp.
References write().
long long VirtualFile::writeUInt16 | ( | unsigned short | data, |
bool | little_endian_data = true |
||
) |
Writes a single entry. Returns the number of bytes written.
Definition at line 313 of file VirtualFile.cpp.
References write16().
Referenced by vl::saveTIFF(), and vlX::VisitorExportToVLB::writeHeader().
long long VirtualFile::writeUInt16 | ( | const unsigned short * | buffer, |
long long | count, | ||
bool | little_endian_data = true |
||
) |
Writes multiple entries. Returns the number of bytes written.
Definition at line 365 of file VirtualFile.cpp.
References write16().
long long VirtualFile::writeUInt32 | ( | unsigned int | data, |
bool | little_endian_data = true |
||
) |
Writes a single entry. Returns the number of bytes written.
Definition at line 303 of file VirtualFile.cpp.
References write32().
Referenced by vl::saveTGA(), vl::saveTIFF(), and vlX::VisitorExportToVLB::writeHeader().
long long VirtualFile::writeUInt32 | ( | const unsigned int * | buffer, |
long long | count, | ||
bool | little_endian_data = true |
||
) |
Writes multiple entries. Returns the number of bytes written.
Definition at line 355 of file VirtualFile.cpp.
References write32().
long long VirtualFile::writeUInt64 | ( | unsigned long long | data, |
bool | little_endian_data = true |
||
) |
Writes a single entry. Returns the number of bytes written.
Definition at line 293 of file VirtualFile.cpp.
References write64().
long long VirtualFile::writeUInt64 | ( | const unsigned long long * | buffer, |
long long | count, | ||
bool | little_endian_data = true |
||
) |
Writes multiple entries. Returns the number of bytes written.
Definition at line 345 of file VirtualFile.cpp.
References write64().
long long VirtualFile::writeUInt8 | ( | unsigned char | data | ) |
Writes a single entry. Returns the number of bytes written.
Definition at line 323 of file VirtualFile.cpp.
References write().
Referenced by vlX::VisitorExportToVLB::visitArray(), vlX::VisitorExportToVLB::visitList(), vlX::VisitorExportToVLB::visitStructure(), and vlX::VisitorExportToVLB::writeValue().
long long VirtualFile::writeUInt8 | ( | const unsigned char * | buffer, |
long long | count | ||
) |
Writes multiple entries. Returns the number of bytes written.
Definition at line 375 of file VirtualFile.cpp.
References write().
|
protected |
Definition at line 246 of file VirtualFile.hpp.
Referenced by operator=().
Visualization Library 2.0.0 Reference Documentation
Updated on Wed Dec 23 2020 12:44:12.
© Copyright Michele Bosi. All rights reserved.