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