#include <djv_chunkdiag.h>
Public Types | |
enum | Action { ThrowException = 0, IgnoreThisChunk = 1, IgnoreThisAndTrailingChunks = 2 } |
Public Member Functions | |
virtual Action | handleError (Chunk *inParentChunk, const String &inNewChunkId, Storage *inStorage, uint64_t inChunkOffset, size_t inChunkLength, const Exception &inException)=0 |
Public Member Functions inherited from Celartem::Referable | |
Referable () | |
void | addRef () const |
void | releaseRef () const |
size_t | getReferenceCount () const |
Additional Inherited Members | |
Static Public Member Functions inherited from Celartem::Referable | |
static void | dumpDbgAllRefCount () |
This class is used to control error handling during \ref IFF::deserialize method.\n By default, \ref IFF::deserialize throws an exception when it encounters the error on loading a chunk. This class is to recover from such kind of errors.\n All you have to do is inherit this class and implement \ref handleError method. Please note that this class should initialized with \c new. The following is a sample use of this class:
|
pure virtual |
This method determines how to treat the error occured during deserialization.
You can also access to the Storage which contains the actual data which causes the loading problem.
inParentChunk | Pointer to the chunk which has been planed to contain the error chunk. |
inNewChunkId | The Id of the error chunk. If the error was occured on decoding the chunk Id, this may be NullString. |
inStorage | The Storage instance which contains the data of the error chunk. You can call readBytes, setPos, and several information methods on this and the caller is responsible for restoring the original state after your code. |
inChunkOffset | The offset of the chunk on inStorage Storage instance. |
inChunkLength | The size of the chunk on inStorage Storage instance. This may be NULL depending on the error cause. |
inException | The exception being thrown. |