00001 #ifndef CLASSLIB_INPUT_STREAM_BUF_H 00002 # define CLASSLIB_INPUT_STREAM_BUF_H 00003 00004 //<<<<<< INCLUDES >>>>>> 00005 00006 # include "classlib/iotools/CustomStreamBuf.h" 00007 # include "classlib/iotools/ReadBuffer.h" 00008 00009 namespace lat { 00010 //<<<<<< PUBLIC DEFINES >>>>>> 00011 //<<<<<< PUBLIC CONSTANTS >>>>>> 00012 //<<<<<< PUBLIC TYPES >>>>>> 00013 00014 class InputStream; 00015 00016 //<<<<<< PUBLIC VARIABLES >>>>>> 00017 //<<<<<< PUBLIC FUNCTIONS >>>>>> 00018 //<<<<<< CLASS DECLARATIONS >>>>>> 00019 00020 class InputStreamBuf : public CustomStreamBuf 00021 { 00022 public: 00023 InputStreamBuf (InputStream *data = 0); 00024 ~InputStreamBuf (void); 00025 00026 virtual InputStream *stream (void); 00027 virtual void attach (InputStream *to); 00028 virtual bool attached (void) const; 00029 virtual void detach (void); 00030 virtual bool close (void); 00031 00032 virtual size_type showmanyc (void); 00033 virtual int_type underflow (void); 00034 virtual int_type uflow (void); 00035 virtual int_type pbackfail (int_type c = CLASSLIB_STREAM_EOF); 00036 virtual size_type xsgetn (char_type *data, size_type length); 00037 00038 private: 00039 size_type refill (void); 00040 00041 InputStream *m_data; 00042 ReadBuffer m_buffer; 00043 }; 00044 00045 //<<<<<< INLINE PUBLIC FUNCTIONS >>>>>> 00046 //<<<<<< INLINE MEMBER FUNCTIONS >>>>>> 00047 00048 } // namespace lat 00049 #endif // CLASSLIB_INPUT_STREAM_BUF_H