HDK
|
#include <FS_FileResolver.h>
Classes | |
class | FS_ResolverFileEntry |
Contains details about the data that the resolver can provide. More... | |
Public Member Functions | |
FS_FileResolver () | |
Constructor. More... | |
virtual | ~FS_FileResolver () |
Destructor. More... | |
virtual bool | getCanResolve (const char *name)=0 |
Checks if the resolver can provide the file data for the given name. More... | |
virtual FS_Reader * | newReader (const FS_FileResolverOptions &opts, const char *name)=0 |
Creates a new reader object given the file (or data) name. More... | |
virtual void | deleteReader (FS_Reader *reader)=0 |
virtual void | acquireFilePath (const FS_FileResolverOptions &opts, const char *name, UT_String &file_path)=0 |
virtual void | relinquishFilePath (const char *file_path)=0 |
virtual void | registerFile (const FS_FileResolverOptions &opts, const UT_StringHolder &name, UT_IStream &data) |
virtual int | getRevisionID (const char *name)=0 |
Static Public Member Functions | |
static void | setResolver (FS_FileResolver *resolver) |
Sets the instance that will resolve the operator paths to data files. More... | |
static FS_FileResolver * | getResolver () |
Returns the currently set resolver. More... | |
Protected Member Functions | |
void | registerFile (const FS_FileResolverOptions &opts, const UT_StringHolder &name, const UT_StringHolder &file_path) |
void | unregisterFile (const UT_StringRef &name, bool delete_file) |
FS_ResolverFileEntry * | findFileInTable (const char *name) |
Maps the operator paths (eg, "op:/path"), and other data sources, to file readers that access their data.
Definition at line 90 of file FS_FileResolver.h.
FS_FileResolver::FS_FileResolver | ( | ) |
Constructor.
|
virtual |
Destructor.
|
pure virtual |
Obtains the file path to the data of a given name. On success, 'file_path' will contain a non-epnty file path. This file path should be then released using FS_FileResolver::relinquishFilePath().
opts | The options that describe the data. |
name | The name of the data available in the file. |
file_path | The output parameter which will have the path of the file that contains the data. If the request fails, the path will be an empty string. |
Implemented in OP_FileResolver.
Closes stream (if they are still open) and deletes the reader. After this call, the reader pointer will no longer be valid.
reader | The reader to be freed. |
Implemented in OP_FileResolver.
|
protected |
Looks up the table entry for the given name key and returns the entry. If not found, returns NULL.
|
pure virtual |
Checks if the resolver can provide the file data for the given name.
Implemented in OP_FileResolver.
|
static |
Returns the currently set resolver.
|
pure virtual |
Returns an instance-unique identifier for a path that can be used to check if the underlying resource data has changed, and should be re-read by the clients of this class.
name | The name of the data to get the identifier for. |
Implemented in OP_FileResolver.
|
pure virtual |
Creates a new reader object given the file (or data) name.
The returned reader can be used to read the data, and when finished, it should be freed by passing it to the FS_FileResolver::deleteReader() method.
opts | The options that indicate how the data should be generated, if applicable. Eg, it contains the evaluation time for nodes or the file format in which the data should be available. |
name | The name of the data to be read. Can be a file specified with "file:/path" or an operator node data specified with "op:/path", or any other standard way of specifying data in Houdini. |
Implemented in OP_FileResolver.
|
virtual |
Adds the data to the resolver, so that the resolver can handle future requests for the data given this name.
opts | Options describe how the data should be interpreted. |
name | The name of the resource. Future requests for this resource using FS_FileResolver::newReader() will returno a reader that provides this data. |
data | The stream containing the data. The resolver will read in and store this data for future use. |
|
protected |
Adds the file to the table. The resolver takes ownership of the file and will delete it in the destructor, unless it is unregistered from the table beforehand, with FS_FileResolver::unregisterFile().
|
pure virtual |
Releases the file path and allows the resolver to (optionally) free the file resources.
file_path | The file path previously obtained with FS_FileResolver::acquireFilePath(). |
Implemented in OP_FileResolver.
|
static |
Sets the instance that will resolve the operator paths to data files.
|
protected |
Removes the file from table, and deletes the file if 'delete_file' is true.