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

# vl::MemoryFile Class Reference

A VirtualFile to manipulate files stored in memory. More...

`#include <MemoryFile.hpp>`

Inheritance diagram for vl::MemoryFile:

List of all members.

## Public Member Functions
virtual const char * | className ()
| Returns the name of the class.
| 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)
virtual bool | isOpen () const
virtual void | close ()
void | allocateBuffer (long long byte_count)
virtual long long | size () const
void | copy (VirtualFile *file)
| Copies the data of any kind of VirtualFile.
MemoryFile & | operator= (const MemoryFile &other)
ref< VirtualFile > | clone () const
## 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

## Detailed Description

A VirtualFile to manipulate files stored in memory.

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

## Constructor & Destructor Documentation

MemoryFile::MemoryFile | ( |  | ) |

## Member Function Documentation

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

Returns the name of the class.

Reimplemented from vl::VirtualFile.

const Buffer* vl::MemoryFile::buffer | ( |  | ) | const`[inline]`

Buffer* vl::MemoryFile::buffer | ( |  | ) | `[inline]`

void vl::MemoryFile::setBuffer | ( | Buffer * | buffer | ) | `[inline]`

This is useful when you want to point more MemoryFiles to the same Buffer object.

unsigned char* vl::MemoryFile::ptr | ( |  | ) | `[inline]`

virtual bool vl::MemoryFile::exists | ( |  | ) | const`[inline, virtual]`

A MemoryFile always exists.

Implements vl::VirtualFile.

bool MemoryFile::open | ( | EOpenMode | mode | ) | `[virtual]`

Implements vl::VirtualFile.

virtual bool vl::MemoryFile::isOpen | ( |  | ) | const`[inline, virtual]`

Implements vl::VirtualFile.

virtual void vl::MemoryFile::close | ( |  | ) | `[inline, virtual]`

Implements vl::VirtualFile.

void vl::MemoryFile::allocateBuffer | ( | long long | byte_count | ) | `[inline]`

virtual long long vl::MemoryFile::size | ( |  | ) | const`[inline, virtual]`

Implements vl::VirtualFile.

void MemoryFile::copy | ( | VirtualFile * | file | ) |

Copies the data of any kind of VirtualFile.

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

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

Implements vl::VirtualFile.

long long MemoryFile::position_Implementation | ( |  | ) | const`[protected, virtual]`

Implements vl::VirtualFile.

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

Implements vl::VirtualFile.

virtual long long vl::MemoryFile::write_Implementation | ( | const void * | ,
|  | long long |  |
| ) |  |  | `[inline, protected, virtual]`

Implements vl::VirtualFile.

bool MemoryFile::seekSet_Implementation | ( | long long | offset | ) | `[protected, virtual]`

Implements vl::VirtualFile.

## Member Data Documentation

ref<Buffer> vl::MemoryFile::mBuffer`[protected]`

long long vl::MemoryFile::mPtr`[protected]`

bool vl::MemoryFile::mIsOpen`[protected]`

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

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

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