+ /*!
+ *\brief Local base class for exceptions.
+ */
+ class exception {
+ protected:
+ exception();
+ public:
+ virtual ~exception();
+ tape_block * get_block();
+ protected:
+ tape_block * m_broken_block;
+ };
+
+ /*!
+ *\brief Checksum error exception.
+ */
+ class checksum_error_exception
+ : public exception {
+ public:
+ checksum_error_exception(tape_block * block);
+ };
+
+ /*!
+ *\brief EOF while reading block exception.
+ */
+ class eof_illegal_exception
+ : public exception {
+ public:
+ eof_illegal_exception(tape_block * block);
+ };
+
+ /*!
+ *\brief EOF after reading block exception.
+ */
+ class eof_legal_exception
+ : public exception {
+ public:
+ eof_legal_exception(int bytes_consumed);
+ int get_consumed();
+ private:
+ int bytes_consumed;
+ tape_block * get_block();
+ };
+
+ /*!
+ *\brief IO error exception.
+ */
+ class io_error_exception
+ : exception {
+ public:
+ io_error_exception();
+ private:
+ tape_block * get_block();
+ };
+
+public: // methods