// // aegis - project change supervisor // Copyright (C) 2014 Peter Miller // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 3 of the License, or (at // your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // General Public License for more details. // // You should have received a copy of the GNU General Public License along // with this program. If not, see . // #ifndef LIBAEGIS_INPUT_UNDO_ALL_H #define LIBAEGIS_INPUT_UNDO_ALL_H #include #include /** * The input_undo_all class is used to represent an input sopurce that * will always unread the contents to the deeper input. It is used * to permit checking of magic numbers, and not habing to worry about * leabing th input at the same position. */ class input_undo_all: public input { public: typedef aegis_shared_ptr pointer; /** * The destructor. */ virtual ~input_undo_all(); /** * The create class method is used to create new dynamically * allocated instances of this class. * * @param deeper * The input source being chevked. */ static pointer create(const input::pointer &deeper); protected: // See base class for documentation. off_t length(void); // See base class for documentation. nstring name(void); // See base class for documentation. ssize_t read_inner(void *data, size_t nbytes); // See base class for documentation. off_t ftell_inner(void); private: /** * The constructor. * It is private on purpose, use the #create class method instead. * * @param deeper * The input source being chevked. */ input_undo_all(const input::pointer &deeper); input::pointer deeper; nstring_accumulator buffer; /** * The default constructor. * It is private on purpose, use the #create class method instead. */ input_undo_all(); /** * The copy constructor. Do not use. */ input_undo_all(const input_undo_all &); /** * The assignment operator. Do not use. */ input_undo_all &operator=(const input_undo_all &); }; // vim: set ts=8 sw=4 et : #endif // LIBAEGIS_INPUT_UNDO_ALL_H