Panda3D
zStream.I
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file zStream.I
10  * @author drose
11  * @date 2002-08-05
12  */
13 
14 /**
15  *
16  */
17 INLINE IDecompressStream::
18 IDecompressStream() : std::istream(&_buf) {
19 }
20 
21 /**
22  *
23  */
24 INLINE IDecompressStream::
25 IDecompressStream(std::istream *source, bool owns_source) : std::istream(&_buf) {
26  open(source, owns_source);
27 }
28 
29 /**
30  *
31  */
32 INLINE IDecompressStream &IDecompressStream::
33 open(std::istream *source, bool owns_source) {
34  clear((ios_iostate)0);
35  _buf.open_read(source, owns_source);
36  return *this;
37 }
38 
39 /**
40  * Resets the ZStream to empty, but does not actually close the source istream
41  * unless owns_source was true.
42  */
43 INLINE IDecompressStream &IDecompressStream::
44 close() {
45  _buf.close_read();
46  return *this;
47 }
48 
49 
50 /**
51  *
52  */
53 INLINE OCompressStream::
54 OCompressStream() : std::ostream(&_buf) {
55 }
56 
57 /**
58  *
59  */
60 INLINE OCompressStream::
61 OCompressStream(std::ostream *dest, bool owns_dest, int compression_level) :
62  std::ostream(&_buf)
63 {
64  open(dest, owns_dest, compression_level);
65 }
66 
67 /**
68  *
69  */
70 INLINE OCompressStream &OCompressStream::
71 open(std::ostream *dest, bool owns_dest, int compression_level) {
72  clear((ios_iostate)0);
73  _buf.open_write(dest, owns_dest, compression_level);
74  return *this;
75 }
76 
77 /**
78  * Resets the ZStream to empty, but does not actually close the dest ostream
79  * unless owns_dest was true.
80  */
81 INLINE OCompressStream &OCompressStream::
82 close() {
83  _buf.close_write();
84  return *this;
85 }