00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef BIOSTREAMBUF_H
00020 #define BIOSTREAMBUF_H
00021
00022 #include "pandabase.h"
00023
00024
00025 #ifdef HAVE_SSL
00026
00027 #include "bioPtr.h"
00028 #include "pointerTo.h"
00029 #include <openssl/ssl.h>
00030
00031
00032
00033
00034
00035
00036 class EXPCL_PANDAEXPRESS BioStreamBuf : public streambuf {
00037 public:
00038 BioStreamBuf();
00039 virtual ~BioStreamBuf();
00040
00041 void open(BioPtr *source);
00042 void close();
00043
00044 protected:
00045 virtual int overflow(int c);
00046 virtual int sync(void);
00047 virtual int underflow(void);
00048
00049 private:
00050 size_t write_chars(const char *start, size_t length);
00051
00052 PT(BioPtr) _source;
00053 bool _is_closed;
00054
00055 friend class IBioStream;
00056 friend class OBioStream;
00057 friend class BioStream;
00058 };
00059
00060 #endif // HAVE_SSL
00061
00062 #endif