Ptex: PtexInputHandler Class Reference

Ptex

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | Protected Member Functions | List of all members
PtexInputHandler Class Referenceabstract

Custom handler interface for intercepting and redirecting Ptex input stream calls. More...

`#include <Ptexture.h>`

Inheritance diagram for PtexInputHandler:

## Public Types
typedef void * | Handle

## Public Member Functions
virtual Handle | open (const char *path)=0
| Open a file in read mode. More...
virtual void | seek (Handle handle, int64_t pos)=0
| Seek to an absolute byte position in the input stream. More...
virtual size_t | read (void *buffer, size_t size, Handle handle)=0
| Read a number of bytes from the file. More...
virtual bool | close (Handle handle)=0
| Close a file. More...
virtual const char * | lastError ()=0
| Return the last error message encountered. More...

## Protected Member Functions
virtual | ~PtexInputHandler ()

## Detailed Description

Custom handler interface for intercepting and redirecting Ptex input stream calls.

A custom instance of this class can be defined and supplied to the PtexCache class. Files accessed through the cache will have their input streams redirected through this interface.

Definition at line 585 of file Ptexture.h.

## Member Typedef Documentation

typedef void* PtexInputHandler::Handle

Definition at line 590 of file Ptexture.h.

## Constructor & Destructor Documentation

virtual PtexInputHandler::~PtexInputHandler | ( |  | ) |
| inlineprotectedvirtual

Definition at line 587 of file Ptexture.h.

## Member Function Documentation

virtual bool PtexInputHandler::close | ( | Handle | handle | ) |
| pure virtual

Close a file.

Returns false if an error occurs, and the error string is available via lastError().

Implemented in PtexReader::DefaultInputHandler.

Referenced by PtexReader::~PtexReader().

virtual const char* PtexInputHandler::lastError | ( |  | ) |
| pure virtual

Return the last error message encountered.

Implemented in PtexReader::DefaultInputHandler.

Referenced by PtexReader::open().

virtual Handle PtexInputHandler::open | ( | const char * | path | ) |
| pure virtual

Open a file in read mode.

Returns null if there was an error. If an error occurs, the error string is available via lastError().

Implemented in PtexReader::DefaultInputHandler.

Referenced by PtexReader::open().

virtual size_t PtexInputHandler::read | ( | void * | buffer,
|  | size_t | size,
|  | Handle | handle
| ) |  |
| pure virtual

Read a number of bytes from the file.

Returns the number of bytes successfully read. If less than the requested number of bytes is read, the error string is available via lastError().

Implemented in PtexReader::DefaultInputHandler.

Referenced by PtexReader::readBlock().

virtual void PtexInputHandler::seek | ( | Handle | handle,
|  | int64_t | pos
| ) |  |
| pure virtual

Seek to an absolute byte position in the input stream.

Implemented in PtexReader::DefaultInputHandler.

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

- Ptexture.h