# Visualization Library

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

[Home] [Tutorials] [All Classes] [Grouped Classes]

Public Member Functions | Protected Member Functions | Protected Attributes | Friends

# vl::DiskFile Class Reference

A VirtualFile that operates on regular disk files. More...

`#include <DiskFile.hpp>`

Inheritance diagram for vl::DiskFile:

List of all members.

## 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

## Detailed Description

A VirtualFile that operates on regular disk files.

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

Definition at line 63 of file DiskFile.hpp.

## Constructor & Destructor Documentation

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

Definition at line 69 of file DiskFile.hpp.

Referenced by clone().

DiskFile::DiskFile | ( | const String & | path = `String()` ) |

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

## Member Function Documentation

bool DiskFile::open | ( | const String & | path,
|  | EOpenMode | mode
| ) |  |

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.

References mHandle, and NULL.

Referenced by open().

void DiskFile::close | ( | ) | `[virtual]`

Closes the file.

Implements vl::VirtualFile.

Definition at line 110 of file DiskFile.cpp.

References mHandle, and NULL.

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

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

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]`

## Friends And Related Function Documentation

friend class DiskDirectory`[friend]`

Definition at line 67 of file DiskFile.hpp.

## Member Data Documentation

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

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

- D:/VL/BuildSystem/VL_DISTRO/Visualization_Library_SDK/src/vlCore/DiskFile.hpp
- D:/VL/BuildSystem/VL_DISTRO/Visualization_Library_SDK/src/vlCore/DiskFile.cpp

Visualization Library v2011.09.1162 Reference Documentation
Copyright 2005-2011 Michele Bosi. All rights reserved.
Updated on Thu Jan 26 2012 00:44:04.
Permission is granted to use this page to write and publish articles regarding Visualization Library.