Panda3D
 All Classes Functions Variables Enumerations
chunkedStream.h
1 // Filename: chunkedStream.h
2 // Created by: drose (25Sep02)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef CHUNKEDSTREAM_H
16 #define CHUNKEDSTREAM_H
17 
18 #include "pandabase.h"
19 
20 // This module is not compiled if OpenSSL is not available.
21 #ifdef HAVE_OPENSSL
22 
23 #include "socketStream.h"
24 #include "chunkedStreamBuf.h"
25 
26 class HTTPChannel;
27 class BioStreamPtr;
28 
29 ////////////////////////////////////////////////////////////////////
30 // Class : IChunkedStream
31 // Description : An input stream object that reads data from a source
32 // istream, but automatically decodes the "chunked"
33 // transfer-coding specified by an HTTP server.
34 //
35 // Seeking is not supported.
36 ////////////////////////////////////////////////////////////////////
37 // No need to export from DLL.
38 class IChunkedStream : public ISocketStream {
39 public:
40  INLINE IChunkedStream();
41  INLINE IChunkedStream(BioStreamPtr *source, HTTPChannel *doc);
42 
43  INLINE IChunkedStream &open(BioStreamPtr *source, HTTPChannel *doc);
44  virtual ~IChunkedStream();
45 
46  virtual bool is_closed();
47  virtual void close();
48  virtual ReadState get_read_state();
49 
50 private:
51  ChunkedStreamBuf _buf;
52 };
53 
54 #include "chunkedStream.I"
55 
56 #endif // HAVE_OPENSSL
57 
58 #endif
59 
60 
61