1 // This file is part of the interchange file format library.
3 // Copyright (C) 2003-2006 by Mike Sharov <msharov@users.sourceforge.net>
4 // This file is free software, distributed under the MIT License.
8 // Exceptions thrown by iff library functions.
11 #ifndef XEPT_H_1166C45177F868B740FD8B3221078767
12 #define XEPT_H_1166C45177F868B740FD8B3221078767
18 //----------------------------------------------------------------------
19 // Exception definitions
20 //----------------------------------------------------------------------
22 /// \class XFormatMismatch xept.h iff.h
23 /// \brief Thrown when the format of the block being read does not match the format requested.
24 class XFormatMismatch
: public exception
{
26 XFormatMismatch (const char* typeName
, uoff_t offset
, fmt_t expected
, fmt_t actual
) throw();
27 virtual const char* what (void) const throw() { return ("IFF format mismatch"); }
28 virtual void info (string
& msgbuf
, const char* fmt
) const throw();
30 const char* m_TypeName
;
36 /// \class XChunkSizeMismatch xept.h iff.h
37 /// \brief Thrown when the calculated size of the block being read differs from the given size.
38 class XChunkSizeMismatch
: public exception
{
40 XChunkSizeMismatch (const char* typeName
, uoff_t offset
, size_t expected
, size_t actual
) throw();
41 virtual const char* what (void) const throw() { return ("IFF chunk size mismatch"); }
42 virtual void info (string
& msgbuf
, const char* fmt
) const throw();
44 const char* m_TypeName
;