Add Custom Helper

To add your own custom file system helpers, start by deriving from FS_ReaderHelper and/or FS_WriterHelper. Although it is not necessary to implement both a reader and writer subclass, you should always implement a FS_InfoHelper subclass if you derive from either one of those.

The FS/FS_HomeHelper.C example shows how to implement a custom helper. It is a toy helper that supports the home: protocol which allows access to files in the HOME directory.

To register your helper, simply construct it in the special installFSHelpers() entry point in your plugin. The base class constructors automatically add themselves to the global helper table.

void
installFSHelpers()
{
    new HDK_Sample::FS_HomeReadHelper();
    new HDK_Sample::FS_HomeWriteHelper();
    new HDK_Sample::FS_HomeInfoHelper();
}

Your helper subclasses then need to overide the createStream() stream method that returns the appropriate stream subclass. It should return NULL if the given source string does not match your protocol prefix.

For FS_InfoHelper, there are several pure virtual classes that are necessary for returning information about the source such as access permission, timestamp, size, directory, and contents.

See also:
FS/FS_HomeHelper.C

Generated on Mon Jan 28 00:47:35 2013 for HDK by  doxygen 1.5.9