# Visualization Library

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

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

Public Member Functions | Protected Attributes

# vl::ResourceLoadWriter Class Reference

The ResourceLoadWriter class is an abstract class used to implement read/write support for one or more resource types. More...

`#include <ResourceLoadWriter.hpp>`

Inheritance diagram for vl::ResourceLoadWriter:

List of all members.

## Public Member Functions

| ResourceLoadWriter (const String &load_extensions, const String &write_extensions)
virtual ref< ResourceDatabase > | loadResource (const String &path) const =0
virtual ref< ResourceDatabase > | loadResource (VirtualFile *file) const =0
virtual bool | writeResource (const String &path, ResourceDatabase *resource) const =0
virtual bool | writeResource (VirtualFile *file, ResourceDatabase *resource) const =0
bool | canLoad (const String &extension) const
| Returns true if the given file type can be loaded.
const String & | loadExtensions () const
| Returns the string containing the file types that can be loaded.
void | setLoadExtensions (const String &extensions)
| Sets the set of file extensions that can be loaded.
bool | canWrite (const String &extension) const
| Returns true if the given file type can be written.
const String & | writeExtensions () const
| Returns the string containing the file types that can be written.
void | setWriteExtensions (const String &extensions)
| Sets the set of file extensions that can be written.

## Protected Attributes

String | mLoadExtensions
String | mWriteExtensions

## Detailed Description

The ResourceLoadWriter class is an abstract class used to implement read/write support for one or more resource types.

Definition at line 44 of file ResourceLoadWriter.hpp.

## Constructor & Destructor Documentation

vl::ResourceLoadWriter::ResourceLoadWriter | ( | const String & | load_extensions,
|  | const String & | write_extensions
| ) |  | `[inline]`

Definition at line 49 of file ResourceLoadWriter.hpp.

## Member Function Documentation

virtual ref<ResourceDatabase> vl::ResourceLoadWriter::loadResource | ( | const String & | path ) | const`[pure virtual]`

Implemented in vl::LoadWriterBMP, vl::LoadWriterDAT, vl::LoadWriterDDS, vl::LoadWriterDICOM, vl::LoadWriterJPG, vl::LoadWriterPNG, vl::LoadWriterTGA, vl::LoadWriterTIFF, vl::LoadWriterDae, vl::LoadWriter3DS, vl::LoadWriterAC3D, vl::LoadWriterMD2, vl::LoadWriterOBJ, vl::LoadWriterPLY, vl::LoadWriterSTL, and vl::LoadWriterVLX.

Referenced by vl::LoadWriterManager::loadResource().

virtual ref<ResourceDatabase> vl::ResourceLoadWriter::loadResource | ( | VirtualFile * | file ) | const`[pure virtual]`

Implemented in vl::LoadWriterBMP, vl::LoadWriterDAT, vl::LoadWriterDDS, vl::LoadWriterDICOM, vl::LoadWriterJPG, vl::LoadWriterPNG, vl::LoadWriterTGA, vl::LoadWriterTIFF, vl::LoadWriterDae, vl::LoadWriter3DS, vl::LoadWriterAC3D, vl::LoadWriterMD2, vl::LoadWriterOBJ, vl::LoadWriterPLY, vl::LoadWriterSTL, and vl::LoadWriterVLX.

virtual bool vl::ResourceLoadWriter::writeResource | ( | const String & | path,
|  | ResourceDatabase * | resource
| ) |  | const`[pure virtual]`

Implemented in vl::LoadWriterBMP, vl::LoadWriterDAT, vl::LoadWriterDDS, vl::LoadWriterDICOM, vl::LoadWriterJPG, vl::LoadWriterPNG, vl::LoadWriterTGA, vl::LoadWriterTIFF, vl::LoadWriterDae, vl::LoadWriter3DS, vl::LoadWriterAC3D, vl::LoadWriterMD2, vl::LoadWriterOBJ, vl::LoadWriterPLY, vl::LoadWriterSTL, and vl::LoadWriterVLX.

Referenced by vl::LoadWriterManager::writeResource().

virtual bool vl::ResourceLoadWriter::writeResource | ( | VirtualFile * | file,
|  | ResourceDatabase * | resource
| ) |  | const`[pure virtual]`

Implemented in vl::LoadWriterBMP, vl::LoadWriterDAT, vl::LoadWriterDDS, vl::LoadWriterDICOM, vl::LoadWriterJPG, vl::LoadWriterPNG, vl::LoadWriterTGA, vl::LoadWriterTIFF, vl::LoadWriterDae, vl::LoadWriter3DS, vl::LoadWriterAC3D, vl::LoadWriterMD2, vl::LoadWriterOBJ, vl::LoadWriterPLY, vl::LoadWriterSTL, and vl::LoadWriterVLX.

bool vl::ResourceLoadWriter::canLoad | ( | const String & | extension ) | const`[inline]`

Returns true if the given file type can be loaded.

Note that the check is not case sensitive.

Definition at line 58 of file ResourceLoadWriter.hpp.

References vl::String::find(), mLoadExtensions, and vl::String::toLowerCase().

const String& vl::ResourceLoadWriter::loadExtensions | ( | ) | const`[inline]`

Returns the string containing the file types that can be loaded.

The extensions returned are always lower-case.

Definition at line 62 of file ResourceLoadWriter.hpp.

References mLoadExtensions.

void vl::ResourceLoadWriter::setLoadExtensions | ( | const String & | extensions ) | `[inline]`

Sets the set of file extensions that can be loaded.

The string must be of the form "|.ext1|.ext2|.ext3|" for example "|.jpg|.png|.gif|". Note that the file extension matching is non case sensitive, so for example the above extension includes also files with the following extensions: .JPG .Png, GiF and so on.

Definition at line 68 of file ResourceLoadWriter.hpp.

References mLoadExtensions, and vl::String::toLowerCase().

bool vl::ResourceLoadWriter::canWrite | ( | const String & | extension ) | const`[inline]`

Returns true if the given file type can be written.

Note that the check is not case sensitive.

Definition at line 72 of file ResourceLoadWriter.hpp.

References vl::String::find(), mWriteExtensions, and vl::String::toLowerCase().

const String& vl::ResourceLoadWriter::writeExtensions | ( | ) | const`[inline]`

Returns the string containing the file types that can be written.

The extensions returned are always lower-case.

Definition at line 76 of file ResourceLoadWriter.hpp.

References mWriteExtensions.

void vl::ResourceLoadWriter::setWriteExtensions | ( | const String & | extensions ) | `[inline]`

Sets the set of file extensions that can be written.

The string must be of the form "|.ext1|.ext2|.ext3|" for example "|.jpg|.png|.gif|". Note that the file extension matching is non case sensitive, so for example the above extension includes also files with the following extensions: .JPG .Png, GiF and so on.

Definition at line 82 of file ResourceLoadWriter.hpp.

References mWriteExtensions, and vl::String::toLowerCase().

## Member Data Documentation

String vl::ResourceLoadWriter::mLoadExtensions`[protected]`

Definition at line 85 of file ResourceLoadWriter.hpp.

Referenced by canLoad(), loadExtensions(), and setLoadExtensions().

String vl::ResourceLoadWriter::mWriteExtensions`[protected]`

Definition at line 86 of file ResourceLoadWriter.hpp.

Referenced by canWrite(), setWriteExtensions(), and writeExtensions().

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

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

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