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