00001 #ifndef CLASSLIB_PUSH_BACK_INPUT_STREAM_H 00002 # define CLASSLIB_PUSH_BACK_INPUT_STREAM_H 00003 00004 //<<<<<< INCLUDES >>>>>> 00005 00006 # include "classlib/iotools/FilterInputStream.h" 00007 00008 namespace lat { 00009 //<<<<<< PUBLIC DEFINES >>>>>> 00010 //<<<<<< PUBLIC CONSTANTS >>>>>> 00011 //<<<<<< PUBLIC TYPES >>>>>> 00012 //<<<<<< PUBLIC VARIABLES >>>>>> 00013 //<<<<<< PUBLIC FUNCTIONS >>>>>> 00014 //<<<<<< CLASS DECLARATIONS >>>>>> 00015 00016 class PushBackInputStream : public FilterInputStream 00017 { 00018 public: 00019 PushBackInputStream (InputStream *input); 00020 ~PushBackInputStream (void); 00021 00022 using FilterInputStream::read; 00023 virtual IOSize available (void); 00024 virtual IOSize read (void *into, IOSize n); 00025 virtual IOSize skip (IOSize n); 00026 virtual void close (void); 00027 virtual void reset (void); 00028 00029 virtual void unread (const void *data, IOSize n); 00030 void unread (IOBuffer from); 00031 00032 private: 00033 unsigned char *m_buffer; 00034 unsigned char *m_bottom; 00035 unsigned char *m_top; 00036 }; 00037 00038 //<<<<<< INLINE PUBLIC FUNCTIONS >>>>>> 00039 //<<<<<< INLINE MEMBER FUNCTIONS >>>>>> 00040 00041 } // namespace lat 00042 #endif // CLASSLIB_PUSH_BACK_INPUT_STREAM_H