32 #ifndef LoadWriterManager_INCLUDE_ONCE 33 #define LoadWriterManager_INCLUDE_ONCE 67 VL_DEBUG_SET_OBJECT_NAME()
73 std::vector< ref<ResourceLoadWriter> >&
loadWriters() {
return mLoadWriters; }
76 const std::vector< ref<ResourceLoadWriter> >&
loadWriters()
const {
return mLoadWriters; }
82 for(
size_t i=0; i<loadWriters().size(); ++i)
84 T* load_writer = loadWriters()[i]->as<T>();
127 const std::vector< ref<LoadCallback> >&
loadCallbacks()
const {
return mLoadCallbacks; }
129 const std::vector< ref<WriteCallback> >&
writeCallbacks()
const {
return mWriteCallbacks; }
131 std::vector< ref<LoadCallback> >&
loadCallbacks() {
return mLoadCallbacks; }
bool canWrite(VirtualFile *file) const
Returns true if there is a ResourceLoadWriter registered to write the specified file.
std::vector< ref< LoadCallback > > mLoadCallbacks
Defines an operation to be exectued to a ResourceDatabase as soon as its loaded, see also LoadWriterM...
An abstract class representing a file.
const std::vector< ref< WriteCallback > > & writeCallbacks() const
The String class implements an advanced UTF16 (Unicode BMP) string manipulation engine.
const std::vector< ref< LoadCallback > > & loadCallbacks() const
The LoadWriterManager class loads and writes resources using the registered ResourceLoadWriter object...
#define VL_INSTRUMENT_CLASS(ClassName, BaseClass)
VLCORE_EXPORT ref< ResourceDatabase > loadResource(const String &path, bool quick=true)
Short version of defLoadWriterManager()->loadResource(path, quick).
const String & path() const
Returns the path of the file.
Visualization Library main namespace.
std::vector< ref< LoadCallback > > & loadCallbacks()
The base class for all the reference counted objects.
std::vector< ref< ResourceLoadWriter > > & loadWriters()
Returns the set of registered ResourceLoadWriter objects.
Defines an operation to be exectued to a ResourceDatabase just before it is written, see also LoadWriterManager, LoadCallback.
bool canWrite(const String &path) const
Returns true if there is a ResourceLoadWriter registered to write the specified path or extension...
bool canLoad(const String &path) const
Returns true if there is a ResourceLoadWriter registered to load the specified path or extension...
VLCORE_EXPORT void setDefLoadWriterManager(LoadWriterManager *lwm)
Sets the default LoadWriterManager used by Visualization Library.
virtual void operator()(ResourceDatabase *db)=0
bool canLoad(VirtualFile *file) const
Returns true if there is a ResourceLoadWriter registered to load the specified file.
The ref<> class is used to reference-count an Object.
std::vector< ref< WriteCallback > > & writeCallbacks()
std::vector< ref< ResourceLoadWriter > > mLoadWriters
The ResourceLoadWriter class is an abstract class used to implement read/write support for one or mor...
const std::vector< ref< ResourceLoadWriter > > & loadWriters() const
Returns the set of registered ResourceLoadWriter objects.
VLCORE_EXPORT bool writeResource(const String &path, ResourceDatabase *resource)
Short version of defLoadWriterManager()->writeResource(path, resource).
T * loadWriter()
Returns the first ResourceLoadWriter of the specified type found.
VLCORE_EXPORT LoadWriterManager * defLoadWriterManager()
Returs the default LoadWriterManager used by Visualization Library.
void registerLoadWriter(ResourceLoadWriter *rlw)
Utility function, equivalent to defLoadWriterManager()->registerLoadWriter(rlw).
The ResourceDatabase class contains and manipulates a set of resources.
void registerLoadWriter(ResourceLoadWriter *)
std::vector< ref< WriteCallback > > mWriteCallbacks