# Visualization Library

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

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

Public Member Functions | Protected Attributes

# vl::LoadWriterManager Class Reference

The LoadWriterManager class loads and writes resources using the registered ResourceLoadWriter objects. More...

`#include <LoadWriterManager.hpp>`

Inheritance diagram for vl::LoadWriterManager:

List of all members.

## Public Member Functions

virtual const char * | className ()
| Returns the name of the class.
| LoadWriterManager ()
| LoadWriterManager (const LoadWriterManager &other)
void | registerLoadWriter (ResourceLoadWriter *)
Collection< ResourceLoadWriter > * | loadWriters ()
| Returns the set of registered ResourceLoadWriter objects.
const Collection < ResourceLoadWriter > * | loadWriters () const
| Returns the set of registered ResourceLoadWriter objects.
template<class T >
T * | loadWriter ()
| Returns the first ResourceLoadWriter of the specified type found.
bool | canLoad (const String &path) const
| Returns true if there is a ResourceLoadWriter registered to load the specified path or extension.
bool | canLoad (VirtualFile *file) const
| Returns true if there is a ResourceLoadWriter registered to load the specified file.
bool | canWrite (const String &path) const
| Returns true if there is a ResourceLoadWriter registered to write the specified path or extension.
bool | canWrite (VirtualFile *file) const
| Returns true if there is a ResourceLoadWriter registered to write the specified file.
const ResourceLoadWriter * | findLoader (const String &path) const
| Returns the ResourceLoadWriter that has been registered to load the resource type specified by the given path or extension.
const ResourceLoadWriter * | findWriter (const String &path) const
| Returns the ResourceLoadWriter that has been registered to write the resource type specified by the given path or extension.
const ResourceLoadWriter * | findLoader (VirtualFile *file) const
| Returns the ResourceLoadWriter that has been registered to load the resource type specified by the given file.
const ResourceLoadWriter * | findWriter (VirtualFile *file) const
| Returns the ResourceLoadWriter that has been registered to write the resource type specified by the given file.
ref< ResourceDatabase > | loadResource (const String &path, bool quick=true) const
| Loads the resource specified by the given path using the appropriate ResourceLoadWriter.
ref< ResourceDatabase > | loadResource (VirtualFile *file, bool quick=true) const
| Loads the resource specified by the given file using the appropriate ResourceLoadWriter.
bool | writeResource (const String &path, ResourceDatabase *resource) const
| Writes the resource specified by the given file using the appropriate ResourceLoadWriter.
bool | writeResource (VirtualFile *file, ResourceDatabase *resource) const
| Writes the resource specified by the given file using the appropriate ResourceLoadWriter.
const Collection< LoadCallback > * | loadCallbacks () const
const Collection< WriteCallback > * | writeCallbacks () const
Collection< LoadCallback > * | loadCallbacks ()
Collection< WriteCallback > * | writeCallbacks ()

## Protected Attributes

Collection< ResourceLoadWriter > | mLoadWriters
Collection< LoadCallback > | mLoadCallbacks
Collection< WriteCallback > | mWriteCallbacks

## Detailed Description

The LoadWriterManager class loads and writes resources using the registered ResourceLoadWriter objects.

You can install a LoadCallback to operate on loaded data or you can install a WriteCallback to operate on the data to be written, using the methods loadCallbacks() and writeCallbacks().

Definition at line 61 of file LoadWriterManager.hpp.

## Constructor & Destructor Documentation

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

Definition at line 66 of file LoadWriterManager.hpp.

References vl::Object::setAutomaticDelete().

vl::LoadWriterManager::LoadWriterManager | ( | const LoadWriterManager & | other ) | `[inline]`

Definition at line 73 of file LoadWriterManager.hpp.

References vl::Object::setAutomaticDelete().

## Member Function Documentation

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

Returns the name of the class.

Reimplemented from vl::Object.

Definition at line 64 of file LoadWriterManager.hpp.

void LoadWriterManager::registerLoadWriter | ( | ResourceLoadWriter * | load_writer ) |

Definition at line 149 of file LoadWriterManager.cpp.

References vl::Collection< T >::erase(), loadWriters(), and vl::Collection< T >::push_back().

Referenced by vl::registerLoadWriter().

Collection<ResourceLoadWriter>* vl::LoadWriterManager::loadWriters | ( | ) | `[inline]`

Returns the set of registered ResourceLoadWriter objects.

Definition at line 83 of file LoadWriterManager.hpp.

Referenced by findLoader(), findWriter(), and registerLoadWriter().

const Collection<ResourceLoadWriter>* vl::LoadWriterManager::loadWriters | ( | ) | const`[inline]`

Returns the set of registered ResourceLoadWriter objects.

Definition at line 86 of file LoadWriterManager.hpp.

template<class T >

T* vl::LoadWriterManager::loadWriter | ( | ) | `[inline]`

Returns the first ResourceLoadWriter of the specified type found.

Definition at line 90 of file LoadWriterManager.hpp.

bool vl::LoadWriterManager::canLoad | ( | const String & | path ) | const`[inline]`

Returns true if there is a ResourceLoadWriter registered to load the specified path or extension.

Definition at line 102 of file LoadWriterManager.hpp.

Referenced by vl::canLoad().

bool vl::LoadWriterManager::canLoad | ( | VirtualFile * | file ) | const`[inline]`

Returns true if there is a ResourceLoadWriter registered to load the specified file.

Definition at line 105 of file LoadWriterManager.hpp.

References vl::VirtualFile::path().

bool vl::LoadWriterManager::canWrite | ( | const String & | path ) | const`[inline]`

Returns true if there is a ResourceLoadWriter registered to write the specified path or extension.

Definition at line 108 of file LoadWriterManager.hpp.

Referenced by vl::canWrite().

bool vl::LoadWriterManager::canWrite | ( | VirtualFile * | file ) | const`[inline]`

Returns true if there is a ResourceLoadWriter registered to write the specified file.

Definition at line 111 of file LoadWriterManager.hpp.

References vl::VirtualFile::path().

const ResourceLoadWriter * LoadWriterManager::findLoader | ( | const String & | path ) | const

Returns the ResourceLoadWriter that has been registered to load the resource type specified by the given path or extension.

Definition at line 129 of file LoadWriterManager.cpp.

References vl::Collection< T >::at(), vl::ResourceLoadWriter::canLoad(), vl::String::extractFileExtension(), loadWriters(), vl::Collection< T >::size(), and vl::String::toLowerCase().

Referenced by findLoader(), and loadResource().

const ResourceLoadWriter * LoadWriterManager::findWriter | ( | const String & | path ) | const

Returns the ResourceLoadWriter that has been registered to write the resource type specified by the given path or extension.

Definition at line 139 of file LoadWriterManager.cpp.

References vl::Collection< T >::at(), vl::ResourceLoadWriter::canWrite(), vl::String::extractFileExtension(), loadWriters(), vl::Collection< T >::size(), and vl::String::toLowerCase().

Referenced by findWriter(), and writeResource().

const ResourceLoadWriter * LoadWriterManager::findLoader | ( | VirtualFile * | file ) | const

Returns the ResourceLoadWriter that has been registered to load the resource type specified by the given file.

Definition at line 39 of file LoadWriterManager.cpp.

References vl::String::empty(), findLoader(), vl::VirtualFile::path(), and vl::Log::warning().

const ResourceLoadWriter * LoadWriterManager::findWriter | ( | VirtualFile * | file ) | const

Returns the ResourceLoadWriter that has been registered to write the resource type specified by the given file.

Definition at line 46 of file LoadWriterManager.cpp.

References vl::String::empty(), findWriter(), vl::VirtualFile::path(), and vl::Log::warning().

ref< ResourceDatabase > LoadWriterManager::loadResource | ( | const String & | path,
|  | bool | quick = `true`
| ) |  | const

Loads the resource specified by the given path using the appropriate ResourceLoadWriter.

Definition at line 53 of file LoadWriterManager.cpp.

References vl::ref< T >::get(), and vl::locateFile().

Referenced by vl::loadImage(), and vl::loadResource().

ref< ResourceDatabase > LoadWriterManager::loadResource | ( | VirtualFile * | file,
|  | bool | quick = `true`
| ) |  | const

Loads the resource specified by the given file using the appropriate ResourceLoadWriter.

Definition at line 62 of file LoadWriterManager.cpp.

References vl::Collection< T >::at(), vl::VirtualFile::close(), vl::Log::error(), findLoader(), vl::ref< T >::get(), loadCallbacks(), vl::ResourceLoadWriter::loadResource(), vl::OM_ReadOnly, vl::VirtualFile::open(), vl::VirtualFile::path(), vl::VirtualFile::read(), vl::Collection< T >::size(), and vl::VirtualFile::size().

bool LoadWriterManager::writeResource | ( | const String & | path,
|  | ResourceDatabase * | resource
| ) |  | const

Writes the resource specified by the given file using the appropriate ResourceLoadWriter.

Definition at line 93 of file LoadWriterManager.cpp.

References vl::Collection< T >::at(), vl::Log::error(), findWriter(), vl::Collection< T >::size(), writeCallbacks(), and vl::ResourceLoadWriter::writeResource().

Referenced by vl::saveImage().

bool LoadWriterManager::writeResource | ( | VirtualFile * | file,
|  | ResourceDatabase * | resource
| ) |  | const

Writes the resource specified by the given file using the appropriate ResourceLoadWriter.

Definition at line 111 of file LoadWriterManager.cpp.

References vl::Collection< T >::at(), vl::Log::error(), findWriter(), vl::VirtualFile::path(), vl::Collection< T >::size(), writeCallbacks(), and vl::ResourceLoadWriter::writeResource().

const Collection<LoadCallback>* vl::LoadWriterManager::loadCallbacks | ( | ) | const`[inline]`

Definition at line 137 of file LoadWriterManager.hpp.

Referenced by loadResource().

const Collection<WriteCallback>* vl::LoadWriterManager::writeCallbacks | ( | ) | const`[inline]`

Definition at line 139 of file LoadWriterManager.hpp.

Referenced by writeResource().

Collection<LoadCallback>* vl::LoadWriterManager::loadCallbacks | ( | ) | `[inline]`

Definition at line 141 of file LoadWriterManager.hpp.

Collection<WriteCallback>* vl::LoadWriterManager::writeCallbacks | ( | ) | `[inline]`

Definition at line 143 of file LoadWriterManager.hpp.

## Member Data Documentation

Collection<ResourceLoadWriter> vl::LoadWriterManager::mLoadWriters`[protected]`

Definition at line 146 of file LoadWriterManager.hpp.

Collection<LoadCallback> vl::LoadWriterManager::mLoadCallbacks`[protected]`

Definition at line 147 of file LoadWriterManager.hpp.

Collection<WriteCallback> vl::LoadWriterManager::mWriteCallbacks`[protected]`

Definition at line 148 of file LoadWriterManager.hpp.

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

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

Visualization Library v2011.05.1142 Reference Documentation
Copyright 2005-2011 Michele Bosi. All rights reserved.
Updated on Thu May 26 2011 22:51:33.
Permission is granted to use this page to write and publish articles regarding Visualization Library.