Panda3D

chunkedStream.h

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