00001 // Filename: chunkedStream.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 CHUNKEDSTREAM_H 00020 #define CHUNKEDSTREAM_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 "chunkedStreamBuf.h" 00029 00030 class HTTPChannel; 00031 class BioStreamPtr; 00032 00033 //////////////////////////////////////////////////////////////////// 00034 // Class : IChunkedStream 00035 // Description : An input stream object that reads data from a source 00036 // istream, but automatically decodes the "chunked" 00037 // transfer-coding specified by an HTTP server. 00038 // 00039 // Seeking is not supported. 00040 //////////////////////////////////////////////////////////////////// 00041 // No need to export from DLL. 00042 class IChunkedStream : public ISocketStream { 00043 public: 00044 INLINE IChunkedStream(); 00045 INLINE IChunkedStream(BioStreamPtr *source, HTTPChannel *doc); 00046 00047 INLINE IChunkedStream &open(BioStreamPtr *source, HTTPChannel *doc); 00048 INLINE IChunkedStream &close(); 00049 00050 virtual bool is_closed(); 00051 00052 private: 00053 ChunkedStreamBuf _buf; 00054 }; 00055 00056 #include "chunkedStream.I" 00057 00058 #endif // HAVE_SSL 00059 00060 #endif 00061 00062 00063