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 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:
vl::Object

List of all members.

Public Member Functions

 LoadWriterManager ()
void registerLoadWriter (ResourceLoadWriter *)
std::vector< ref
< ResourceLoadWriter > > & 
loadWriters ()
 Returns the set of registered ResourceLoadWriter objects.
const std::vector< ref
< 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 ResourceLoadWriterfindLoader (const String &path) const
 Returns the ResourceLoadWriter that has been registered to load the resource type specified by the given path or extension.
const ResourceLoadWriterfindWriter (const String &path) const
 Returns the ResourceLoadWriter that has been registered to write the resource type specified by the given path or extension.
const ResourceLoadWriterfindLoader (VirtualFile *file) const
 Returns the ResourceLoadWriter that has been registered to load the resource type specified by the given file.
const ResourceLoadWriterfindWriter (VirtualFile *file) const
 Returns the ResourceLoadWriter that has been registered to write the resource type specified by the given file.
ref< ResourceDatabaseloadResource (const String &path, bool quick=true) const
 Loads the resource specified by the given path using the appropriate ResourceLoadWriter.
ref< ResourceDatabaseloadResource (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 std::vector< ref
< LoadCallback > > & 
loadCallbacks () const
const std::vector< ref
< WriteCallback > > & 
writeCallbacks () const
std::vector< ref< LoadCallback > > & loadCallbacks ()
std::vector< ref
< WriteCallback > > & 
writeCallbacks ()

Protected Attributes

std::vector< ref
< ResourceLoadWriter > > 
mLoadWriters
std::vector< ref< LoadCallback > > mLoadCallbacks
std::vector< ref< 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 60 of file LoadWriterManager.hpp.


Constructor & Destructor Documentation

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

Definition at line 65 of file LoadWriterManager.hpp.

References VL_DEBUG_SET_OBJECT_NAME.


Member Function Documentation

void LoadWriterManager::registerLoadWriter ( ResourceLoadWriter load_writer )

Definition at line 176 of file LoadWriterManager.cpp.

References loadWriters().

Referenced by vl::registerLoadWriter().

std::vector< ref<ResourceLoadWriter> >& vl::LoadWriterManager::loadWriters (  ) [inline]

Returns the set of registered ResourceLoadWriter objects.

Definition at line 73 of file LoadWriterManager.hpp.

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

const std::vector< ref<ResourceLoadWriter> >& vl::LoadWriterManager::loadWriters (  ) const [inline]

Returns the set of registered ResourceLoadWriter objects.

Definition at line 76 of file LoadWriterManager.hpp.

template<class T >
T* vl::LoadWriterManager::loadWriter (  ) [inline]

Returns the first ResourceLoadWriter of the specified type found.

Definition at line 80 of file LoadWriterManager.hpp.

References NULL.

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 92 of file LoadWriterManager.hpp.

References NULL.

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 95 of file LoadWriterManager.hpp.

References NULL, and 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 98 of file LoadWriterManager.hpp.

References NULL.

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 101 of file LoadWriterManager.hpp.

References NULL, and 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 156 of file LoadWriterManager.cpp.

References vl::String::extractFileExtension(), loadWriters(), NULL, 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 166 of file LoadWriterManager.cpp.

References vl::String::extractFileExtension(), loadWriters(), NULL, 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 41 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 48 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 55 of file LoadWriterManager.cpp.

References vl::Log::debug(), vl::String::endsWith(), vl::ref< T >::get(), vl::locateFile(), and NULL.

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

ref< ResourceDatabase > LoadWriterManager::loadResource ( VirtualFile file,
bool  quick = true 
) const
bool LoadWriterManager::writeResource ( const String path,
ResourceDatabase resource 
) const

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

Definition at line 120 of file LoadWriterManager.cpp.

References vl::Log::error(), findWriter(), writeCallbacks(), and vl::ResourceLoadWriter::writeResource().

Referenced by vl::saveImage(), and vl::writeResource().

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

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

Definition at line 138 of file LoadWriterManager.cpp.

References vl::Log::error(), findWriter(), vl::VirtualFile::path(), writeCallbacks(), and vl::ResourceLoadWriter::writeResource().

const std::vector< ref<LoadCallback> >& vl::LoadWriterManager::loadCallbacks (  ) const [inline]

Definition at line 127 of file LoadWriterManager.hpp.

Referenced by loadResource().

const std::vector< ref<WriteCallback> >& vl::LoadWriterManager::writeCallbacks (  ) const [inline]

Definition at line 129 of file LoadWriterManager.hpp.

Referenced by writeResource().

std::vector< ref<LoadCallback> >& vl::LoadWriterManager::loadCallbacks (  ) [inline]

Definition at line 131 of file LoadWriterManager.hpp.

std::vector< ref<WriteCallback> >& vl::LoadWriterManager::writeCallbacks (  ) [inline]

Definition at line 133 of file LoadWriterManager.hpp.


Member Data Documentation

Definition at line 136 of file LoadWriterManager.hpp.

Definition at line 137 of file LoadWriterManager.hpp.

Definition at line 138 of file LoadWriterManager.hpp.


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.