HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
OP_FileResolver Class Reference

Cooks node data and makes it available through the reader. More...

#include <OP_FileResolver.h>

+ Inheritance diagram for OP_FileResolver:

Public Member Functions

 OP_FileResolver ()
 Constructor. More...
 
virtual bool getCanResolve (const char *name)
 Checks if the resolver can provide the file data for the given name. More...
 
virtual FS_ReadernewReader (const FS_FileResolverOptions &opts, const char *name)
 Creates a new reader object given the file (or data) name. More...
 
virtual void deleteReader (FS_Reader *reader)
 
virtual void acquireFilePath (const FS_FileResolverOptions &opts, const char *name, UT_String &file_path)
 
virtual void relinquishFilePath (const char *file_path)
 
virtual int getRevisionID (const char *name)
 
- Public Member Functions inherited from FS_FileResolver
 FS_FileResolver ()
 Constructor. More...
 
virtual ~FS_FileResolver ()
 Destructor. More...
 
virtual void registerFile (const FS_FileResolverOptions &opts, const UT_StringHolder &name, UT_IStream &data)
 

Additional Inherited Members

- Static Public Member Functions inherited from FS_FileResolver
static void setResolver (FS_FileResolver *resolver)
 Sets the instance that will resolve the operator paths to data files. More...
 
static FS_FileResolvergetResolver ()
 Returns the currently set resolver. More...
 
- Protected Member Functions inherited from FS_FileResolver
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_ResolverFileEntryfindFileInTable (const char *name)
 

Detailed Description

Cooks node data and makes it available through the reader.

Definition at line 27 of file OP_FileResolver.h.

Constructor & Destructor Documentation

OP_FileResolver::OP_FileResolver ( )

Constructor.

Member Function Documentation

virtual void OP_FileResolver::acquireFilePath ( const FS_FileResolverOptions opts,
const char *  name,
UT_String file_path 
)
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().

Parameters
optsThe options that describe the data.
nameThe name of the data available in the file.
file_pathThe 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.

Implements FS_FileResolver.

virtual void OP_FileResolver::deleteReader ( FS_Reader reader)
virtual

Closes stream (if they are still open) and deletes the reader. After this call, the reader pointer will no longer be valid.

Parameters
readerThe reader to be freed.

Implements FS_FileResolver.

virtual bool OP_FileResolver::getCanResolve ( const char *  name)
virtual

Checks if the resolver can provide the file data for the given name.

Implements FS_FileResolver.

virtual int OP_FileResolver::getRevisionID ( const char *  name)
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.

Parameters
nameThe name of the data to get the identifier for.
Returns
The revision id of the data. Returns 0 if the resource does not exist or revision IDs are not supported.

Implements FS_FileResolver.

virtual FS_Reader* OP_FileResolver::newReader ( const FS_FileResolverOptions opts,
const char *  name 
)
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.

Parameters
optsThe 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.
nameThe 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.
Returns
The reader for the specified data.

Implements FS_FileResolver.

virtual void OP_FileResolver::relinquishFilePath ( const char *  file_path)
virtual

Releases the file path and allows the resolver to (optionally) free the file resources.

Parameters
file_pathThe file path previously obtained with FS_FileResolver::acquireFilePath().

Implements FS_FileResolver.


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