Panda3D
|
00001 // Filename: bioStream.h 00002 // Created by: drose (25Sep02) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 #ifndef BIOSTREAM_H 00016 #define BIOSTREAM_H 00017 00018 #include "pandabase.h" 00019 00020 // This module is not compiled if OpenSSL is not available. 00021 #ifdef HAVE_OPENSSL 00022 00023 #include "socketStream.h" 00024 #include "bioStreamBuf.h" 00025 00026 //////////////////////////////////////////////////////////////////// 00027 // Class : IBioStream 00028 // Description : An input stream object that reads data from an 00029 // OpenSSL BIO object. This is used by the HTTPClient 00030 // and HTTPChannel classes to provide a C++ interface 00031 // to OpenSSL. 00032 // 00033 // Seeking is not supported. 00034 //////////////////////////////////////////////////////////////////// 00035 class EXPCL_PANDAEXPRESS IBioStream : public ISocketStream { 00036 public: 00037 INLINE IBioStream(); 00038 INLINE IBioStream(BioPtr *source); 00039 00040 INLINE IBioStream &open(BioPtr *source); 00041 00042 virtual bool is_closed(); 00043 virtual void close(); 00044 virtual ReadState get_read_state(); 00045 00046 private: 00047 BioStreamBuf _buf; 00048 }; 00049 00050 //////////////////////////////////////////////////////////////////// 00051 // Class : OBioStream 00052 // Description : An output stream object that writes data to an 00053 // OpenSSL BIO object. This is used by the HTTPClient 00054 // and HTTPChannel classes to provide a C++ interface 00055 // to OpenSSL. 00056 // 00057 // Seeking is not supported. 00058 //////////////////////////////////////////////////////////////////// 00059 class EXPCL_PANDAEXPRESS OBioStream : public OSocketStream { 00060 public: 00061 INLINE OBioStream(); 00062 INLINE OBioStream(BioPtr *source); 00063 00064 INLINE OBioStream &open(BioPtr *source); 00065 00066 virtual bool is_closed(); 00067 virtual void close(); 00068 00069 private: 00070 BioStreamBuf _buf; 00071 }; 00072 00073 //////////////////////////////////////////////////////////////////// 00074 // Class : BioStream 00075 // Description : A bi-directional stream object that reads and writes 00076 // data to an OpenSSL BIO object. 00077 //////////////////////////////////////////////////////////////////// 00078 class EXPCL_PANDAEXPRESS BioStream : public SocketStream { 00079 public: 00080 INLINE BioStream(); 00081 INLINE BioStream(BioPtr *source); 00082 00083 INLINE BioStream &open(BioPtr *source); 00084 00085 virtual bool is_closed(); 00086 virtual void close(); 00087 00088 private: 00089 BioStreamBuf _buf; 00090 }; 00091 00092 #include "bioStream.I" 00093 00094 #endif // HAVE_OPENSSL 00095 00096 00097 #endif 00098 00099