# Visualization Library A lightweight C++ OpenGL middleware for 2D/3D graphics | [Home] [Tutorials] [All Classes] [Grouped Classes]

# vl::VirtualFile Class Reference

An abstract class representing a file. More...

`#include <VirtualFile.hpp>`

Inheritance diagram for vl::VirtualFile:

List of all members.

## Public Member Functions
virtual const char * | className ()
| Returns the name of the class.
| VirtualFile ()
| ~VirtualFile ()
unsigned int | crc32 ()
MD5CheckSum | md5 ()
virtual bool | open (EOpenMode mode)=0
virtual bool | isOpen () const =0
virtual bool | exists () const =0
virtual void | close ()=0
virtual long long | size () const =0
virtual ref< VirtualFile > | clone () const =0
VirtualFile & | operator= (const VirtualFile &other)
const String & | path () const
void | setPath (const String &name)
| Renames the file. Use carefully this function, you shouldn't rename a VirtualFile managed by a VirtualDirectory.
long long | peek (void *buffer, long long byte_count)
| Reads byte_count bytes and returns to the original position.
long long | read (void *buffer, long long byte_count)
long long | write (const void *buffer, long long byte_count)
long long | position () const
bool | seekSet (long long offset)
bool | seekCur (long long offset)
bool | seekEnd (long long offset)
bool | endOfFile () const
long long | load (std::vector< unsigned char > &data)
| Loads the entire file in the specified vector.
long long | load (void *buffer, long long max=-1)
| Loads the entire file in the specified buffer.
float | readFloat (bool little_endian_data=true)
long long | readFloat (void *buffer, long long count)
double | readDouble (bool little_endian_data=true)
long long | readDouble (void *buffer, long long count)
unsigned char | readUByte ()
long long | readUByte (void *buffer, long long count)
char | readSByte ()
long long | readSByte (void *buffer, long long count)
unsigned long long | readUInt64 (bool little_endian_data=true)
long long | readUInt64 (void *buffer, long long count, bool little_endian_data=true)
long long | readSInt64 (bool little_endian_data=true)
long long | readSInt64 (void *buffer, long long count, bool little_endian_data=true)
unsigned int | readUInt32 (bool little_endian_data=true)
long long | readUInt32 (void *buffer, long long count, bool little_endian_data=true)
int | readSInt32 (bool little_endian_data=true)
long long | readSInt32 (void *buffer, long long count, bool little_endian_data=true)
unsigned short | readUInt16 (bool little_endian_data=true)
long long | readUInt16 (void *buffer, long long count, bool little_endian_data=true)
short | readSInt16 (bool little_endian_data=true)
long long | readSInt16 (void *buffer, long long count, bool little_endian_data=true)
long long | writeUInt32 (unsigned long data, bool little_endian=true)
long long | writeUInt16 (unsigned short data, bool little_endian=true)
long long | writeUInt8 (unsigned char data)
long long | writeSInt32 (long data, bool little_endian=true)
long long | writeSInt16 (short data, bool little_endian=true)
long long | writeSInt8 (char data)
## 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
## Protected Attributes
String | mPath

## Detailed Description

An abstract class representing a file.

See also:
  - VirtualDirectory
  - DiskDirectory
  - MemoryDirectory
  - ZippedDirectory
  - FileSystem
  - DiskFile
  - MemoryFile
  - ZippedFile

## Constructor & Destructor Documentation

vl::VirtualFile::VirtualFile | ( | const VirtualFile & | other | ) | `[inline, protected]`

vl::VirtualFile::VirtualFile | ( |  | ) | `[inline]`

vl::VirtualFile::~VirtualFile | ( |  | ) | `[inline]`

## Member Function Documentation

virtual const char* vl::VirtualFile::className | ( |  | ) | `[inline, virtual]`

Returns the name of the class.

Reimplemented from vl::Object.

Reimplemented in vl::DiskFile, vl::GZipCodec, vl::MemoryFile, and vl::ZippedFile.

unsigned int VirtualFile::crc32 | ( |  | ) |

MD5CheckSum VirtualFile::md5 | ( |  | ) |

virtual bool vl::VirtualFile::open | ( | EOpenMode | mode | ) | `[pure virtual]`

Implemented in vl::DiskFile, vl::GZipCodec, vl::MemoryFile, and vl::ZippedFile.

virtual bool vl::VirtualFile::isOpen | ( |  | ) | const`[pure virtual]`

Implemented in vl::DiskFile, vl::GZipCodec, vl::MemoryFile, and vl::ZippedFile.

virtual bool vl::VirtualFile::exists | ( |  | ) | const`[pure virtual]`

Implemented in vl::DiskFile, vl::GZipCodec, vl::MemoryFile, and vl::ZippedFile.

virtual void vl::VirtualFile::close | ( |  | ) | `[pure virtual]`

Implemented in vl::DiskFile, vl::GZipCodec, vl::MemoryFile, and vl::ZippedFile.

virtual long long vl::VirtualFile::size | ( |  | ) | const`[pure virtual]`

Implemented in vl::DiskFile, vl::GZipCodec, vl::MemoryFile, and vl::ZippedFile.

virtual ref<VirtualFile> vl::VirtualFile::clone | ( |  | ) | const`[pure virtual]`

Implemented in vl::DiskFile, vl::GZipCodec, vl::MemoryFile, and vl::ZippedFile.

VirtualFile& vl::VirtualFile::operator= | ( | const VirtualFile & | other | ) | `[inline]`

const String& vl::VirtualFile::path | ( |  | ) | const`[inline]`

void vl::VirtualFile::setPath | ( | const String & | name | ) | `[inline]`

Renames the file. Use carefully this function, you shouldn't rename a VirtualFile managed by a VirtualDirectory.

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.

long long VirtualFile::read | ( | void * | buffer,
|  | long long | byte_count |
| ) |  |  |

long long VirtualFile::write | ( | const void * | buffer,
|  | long long | byte_count |
| ) |  |  |

long long VirtualFile::position | ( |  | ) | const

bool VirtualFile::seekSet | ( | long long | offset | ) |

bool VirtualFile::seekCur | ( | long long | offset | ) |

bool VirtualFile::seekEnd | ( | long long | offset | ) |

bool vl::VirtualFile::endOfFile | ( |  | ) | const`[inline]`

long long VirtualFile::load | ( | std::vector< unsigned 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.

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.

float VirtualFile::readFloat | ( | bool | little_endian_data = `true` | ) |

long long VirtualFile::readFloat | ( | void * | buffer,
|  | long long | count |
| ) |  |  |

double VirtualFile::readDouble | ( | bool | little_endian_data = `true` | ) |

long long VirtualFile::readDouble | ( | void * | buffer,
|  | long long | count |
| ) |  |  |

unsigned char VirtualFile::readUByte | ( |  | ) |

long long VirtualFile::readUByte | ( | void * | buffer,
|  | long long | count |
| ) |  |  |

char VirtualFile::readSByte | ( |  | ) |

long long VirtualFile::readSByte | ( | void * | buffer,
|  | long long | count |
| ) |  |  |

unsigned long long VirtualFile::readUInt64 | ( | bool | little_endian_data = `true` | ) |

long long VirtualFile::readUInt64 | ( | void * | buffer,
|  | long long | count,
|  | bool | little_endian_data = `true` |
| ) |  |  |

long long VirtualFile::readSInt64 | ( | bool | little_endian_data = `true` | ) |

long long VirtualFile::readSInt64 | ( | void * | buffer,
|  | long long | count,
|  | bool | little_endian_data = `true` |
| ) |  |  |

unsigned int VirtualFile::readUInt32 | ( | bool | little_endian_data = `true` | ) |

long long VirtualFile::readUInt32 | ( | void * | buffer,
|  | long long | count,
|  | bool | little_endian_data = `true` |
| ) |  |  |

int VirtualFile::readSInt32 | ( | bool | little_endian_data = `true` | ) |

long long VirtualFile::readSInt32 | ( | void * | buffer,
|  | long long | count,
|  | bool | little_endian_data = `true` |
| ) |  |  |

unsigned short VirtualFile::readUInt16 | ( | bool | little_endian_data = `true` | ) |

long long VirtualFile::readUInt16 | ( | void * | buffer,
|  | long long | count,
|  | bool | little_endian_data = `true` |
| ) |  |  |

short VirtualFile::readSInt16 | ( | bool | little_endian_data = `true` | ) |

long long VirtualFile::readSInt16 | ( | void * | buffer,
|  | long long | count,
|  | bool | little_endian_data = `true` |
| ) |  |  |

long long VirtualFile::writeUInt32 | ( | unsigned long | data,
|  | bool | little_endian = `true` |
| ) |  |  |

long long VirtualFile::writeUInt16 | ( | unsigned short | data,
|  | bool | little_endian = `true` |
| ) |  |  |

long long VirtualFile::writeUInt8 | ( | unsigned char | data | ) |

long long VirtualFile::writeSInt32 | ( | long | data,
|  | bool | little_endian = `true` |
| ) |  |  |

long long VirtualFile::writeSInt16 | ( | short | data,
|  | bool | little_endian = `true` |
| ) |  |  |

long long VirtualFile::writeSInt8 | ( | char | data | ) |

virtual long long vl::VirtualFile::read_Implementation | ( | void * | buffer,
|  | long long | byte_count |
| ) |  |  | `[protected, pure virtual]`

Implemented in vl::DiskFile, vl::GZipCodec, vl::MemoryFile, and vl::ZippedFile.

virtual long long vl::VirtualFile::write_Implementation | ( | const void * | buffer,
|  | long long | byte_count |
| ) |  |  | `[protected, pure virtual]`

Implemented in vl::DiskFile, vl::GZipCodec, vl::MemoryFile, and vl::ZippedFile.

virtual long long vl::VirtualFile::position_Implementation | ( |  | ) | const`[protected, pure virtual]`

Implemented in vl::DiskFile, vl::GZipCodec, vl::MemoryFile, and vl::ZippedFile.

virtual bool vl::VirtualFile::seekSet_Implementation | ( | long long | offset | ) | `[protected, pure virtual]`

Implemented in vl::DiskFile, vl::GZipCodec, vl::MemoryFile, and vl::ZippedFile.

## Member Data Documentation

String vl::VirtualFile::mPath`[protected]`

The documentation for this class was generated from the following files:

- E:/VisualizationLibrary/BuildSystem/VL_DISTRO/Visualization_Library_SDK/src/vl/VirtualFile.hpp
- E:/VisualizationLibrary/BuildSystem/VL_DISTRO/Visualization_Library_SDK/src/vl/VirtualFile.cpp

Visualization Library v2009.08 Reference Documentation
Copyright 2005-2009 Michele Bosi. All rights reserved.
Updated on Sun Nov 8 14:29:11 2009.
Permission is granted to use this page to write and publish articles regarding Visualization Library.