Visualization Library v1.0.3

A lightweight C++ OpenGL middleware for 2D/3D graphics

VL     Star     Watch     Fork     Issue

[Download] [Tutorials] [All Classes] [Grouped Classes]
Public Member Functions | Protected Member Functions | Protected Attributes

vl::MemoryFile Class Reference

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

#include <MemoryFile.hpp>

Inheritance diagram for vl::MemoryFile:
vl::VirtualFile vl::Object

List of all members.

Public Member Functions

 MemoryFile ()
const Bufferbuffer () const
Bufferbuffer ()
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.
MemoryFileoperator= (const MemoryFile &other)
ref< VirtualFileclone () 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< BuffermBuffer
long long mPtr
bool mIsOpen

Detailed Description

A VirtualFile to manipulate files stored in memory.

See also:

Definition at line 56 of file MemoryFile.hpp.


Constructor & Destructor Documentation

MemoryFile::MemoryFile (  )

Definition at line 40 of file MemoryFile.cpp.

References mBuffer, mIsOpen, and mPtr.

Referenced by clone().


Member Function Documentation

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]

Closes the file.

Implements vl::VirtualFile.

Definition at line 79 of file MemoryFile.hpp.

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 )
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.

References isOpen(), and mPtr.

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

Implements vl::VirtualFile.

Definition at line 81 of file MemoryFile.cpp.

References isOpen(), mBuffer, mPtr, and ptr().

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.

References isOpen(), mBuffer, and mPtr.


Member Data Documentation

Definition at line 102 of file MemoryFile.hpp.

Referenced by MemoryFile(), operator=(), read_Implementation(), and seekSet_Implementation().

long long vl::MemoryFile::mPtr [protected]
bool vl::MemoryFile::mIsOpen [protected]

Definition at line 104 of file MemoryFile.hpp.

Referenced by MemoryFile(), and open().


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

Visualization Library v1.0.3 Reference Documentation
Copyright Michele Bosi. All rights reserved.
Updated on Tue Feb 7 2017 00:55:06.
Permission is granted to use this page to write and publish articles regarding Visualization Library.