44 Log::warning(
"findLoader(VirtualFile* file): cannot check the file extension, file->path() is empty!\n");
51 Log::warning(
"findWriter(VirtualFile* file): cannot check the file extension, file->path() is empty!\n");
59 TimerClass(
const String* path): mPath(path)
65 Log::debug(
Say(
"loadResource('%s'): %ns\n") << *mPath << mTimer.elapsed() );
115 Log::error(
Say(
"no ResourceLoadWriter registered to load '%s'.\n") << file->
path() );
133 Log::error(
Say(
"no ResourceLoadWriter registered to write '%s'.\n") << path );
151 Log::error(
Say(
"no ResourceLoadWriter registered to write '%s'.\n") << file->
path() );
182 std::vector< ref<ResourceLoadWriter> >::iterator it = std::find(
loadWriters().begin(),
loadWriters().end(), load_writer );
static void debug(const String &message)
Use this function to provide extra information useful to investigate and solve problems.
virtual ref< ResourceDatabase > loadResource(const String &path) const =0
String toLowerCase() const
Returns the lower-case version of a String.
VLCORE_EXPORT bool canLoad(const String &path)
Short version of defLoadWriterManager()->canLoad(path).
long long read(void *buffer, long long byte_count)
Reads byte_count bytes from a file. Returns the number of bytes actually read.
String extractFileExtension(bool require_dot=true) const
If the String contains a file name or file path the function returns the extension of the file...
An abstract class representing a file.
A simple String formatting class.
static void warning(const String &message)
Use this function to provide information about situations that might lead to errors or loss of data...
const std::vector< ref< WriteCallback > > & writeCallbacks() const
The String class implements an advanced UTF16 (Unicode BMP) string manipulation engine.
bool canLoad(const String &extension) const
Returns true if the given file type can be loaded.
void setStream(VirtualFile *stream)
Installs the VirtualFile representing the GZip file to be read or to be written.
const std::vector< ref< LoadCallback > > & loadCallbacks() const
ref< ResourceDatabase > loadResource(const String &path, bool quick=true) const
Loads the resource specified by the given path using the appropriate ResourceLoadWriter.
static void error(const String &message)
Use this function to provide information about run-time errors: file not found, out of memory...
String left(int count) const
Returns the count leftmost caracters of a String. If count is negative the function returns all but t...
virtual bool writeResource(const String &path, ResourceDatabase *resource) const =0
virtual void close()=0
Closes the file.
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.
Simple class to be used as a timer and to retrieve the current time and date.
A VirtualFile to manipulate files stored in memory.
VLCORE_EXPORT bool canWrite(const String &path)
Short version of defLoadWriterManager()->canWrite(path).
The GZipCodec class is a VirtualFile that transparently encodes and decodes a stream of data using th...
bool empty() const
Returns true if length() == 0.
virtual bool open(EOpenMode mode)=0
Opens the file in the specified mode.
const ResourceLoadWriter * findWriter(const String &path) const
Returns the ResourceLoadWriter that has been registered to write the resource type specified by the g...
std::vector< ref< ResourceLoadWriter > > & loadWriters()
Returns the set of registered ResourceLoadWriter objects.
virtual long long size() const =0
Returns the size of the file in bytes.
void allocateBuffer(long long byte_count)
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 ref< VirtualFile > locateFile(const String &path)
Utility function, equivalent to vl::defFileSystem()->locateFile(path)
void setPath(const String &name)
Changes the path bound to a VirtualFile. Use carefully this function, you shouldn't rename a VirtualF...
The ref<> class is used to reference-count an Object.
bool endsWith(const String &str) const
Returns true if a String ends with the specified String str.
The ResourceLoadWriter class is an abstract class used to implement read/write support for one or mor...
VLCORE_EXPORT bool writeResource(const String &path, ResourceDatabase *resource)
Short version of defLoadWriterManager()->writeResource(path, resource).
VLCORE_EXPORT LoadWriterManager * defLoadWriterManager()
Returs the default LoadWriterManager used by Visualization Library.
The ResourceDatabase class contains and manipulates a set of resources.
const ResourceLoadWriter * findLoader(const String &path) const
Returns the ResourceLoadWriter that has been registered to load the resource type specified by the gi...
bool writeResource(const String &path, ResourceDatabase *resource) const
Writes the resource specified by the given file using the appropriate ResourceLoadWriter.
void registerLoadWriter(ResourceLoadWriter *)