Panda3D
Loading...
Searching...
No Matches
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 */
17INLINE IDecompressStream::
18IDecompressStream() : std::istream(&_buf) {
19}
20
21/**
22 *
23 */
24INLINE IDecompressStream::
25IDecompressStream(std::istream *source, bool owns_source) : std::istream(&_buf) {
26 open(source, owns_source);
27}
28
29/**
30 *
31 */
32INLINE IDecompressStream &IDecompressStream::
33open(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 */
43INLINE IDecompressStream &IDecompressStream::
44close() {
45 _buf.close_read();
46 return *this;
47}
48
49
50/**
51 *
52 */
53INLINE OCompressStream::
54OCompressStream() : std::ostream(&_buf) {
55}
56
57/**
58 *
59 */
60INLINE OCompressStream::
61OCompressStream(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 */
70INLINE OCompressStream &OCompressStream::
71open(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 */
81INLINE OCompressStream &OCompressStream::
82close() {
83 _buf.close_write();
84 return *this;
85}
STL namespace.