#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 |
new. The following is a sample use of this class: class MyErrorRecovery : public IFFErrorRecoveryHandler { public: virtual Action handleError( Chunk* inParentChunk, const String& inNewChunkId, Storage* inStorage, uint64_t inChunkOffset, size_t inChunkLength, const Exception& inException) { // This method ignores chunks with loading errors. return IgnoreThisChunk; } }; ... AutoPtr<MyErrorRecovery> recvHandler = new MyErrorRecovery(); AutoPtr<Chunk> chunk = IFF::deserialize( storage, NULL, NULL, NULL, NULL, recvHandler);
Definition at line 57 of file djv_chunkdiag.h.
This enumeration is used to determine how to treat the error.
| ThrowException | Throw the exception. |
| IgnoreThisChunk | Ignore only this broken chunk. |
| IgnoreThisAndTrailingChunks | Ignore this and the trailing chunks. |
Definition at line 63 of file djv_chunkdiag.h.
| virtual Action Celartem::DjVu::IFFErrorRecoveryHandler::handleError | ( | Chunk * | inParentChunk, | |
| const String & | inNewChunkId, | |||
| Storage * | inStorage, | |||
| uint64_t | inChunkOffset, | |||
| size_t | inChunkLength, | |||
| const Exception & | inException | |||
| ) | [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. |