MCPcopy Create free account
hub / github.com/XJTU-Graphics/dandelion / open

Method open

deps/assimp/code/Common/Compression.cpp:76–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74}
75
76bool Compression::open(Format format, FlushMode flush, int windowBits) {
77 ai_assert(mImpl != nullptr);
78
79 if (mImpl->mOpen) {
80 return false;
81 }
82
83 // build a zlib stream
84 mImpl->mZSstream.opaque = Z_NULL;
85 mImpl->mZSstream.zalloc = Z_NULL;
86 mImpl->mZSstream.zfree = Z_NULL;
87 mImpl->mFlushMode = flush;
88 if (format == Format::Binary) {
89 mImpl->mZSstream.data_type = Z_BINARY;
90 } else {
91 mImpl->mZSstream.data_type = Z_ASCII;
92 }
93
94 // raw decompression without a zlib or gzip header
95 if (windowBits == 0) {
96 inflateInit(&mImpl->mZSstream);
97 } else {
98 inflateInit2(&mImpl->mZSstream, windowBits);
99 }
100 mImpl->mOpen = true;
101
102 return mImpl->mOpen;
103}
104
105static int getFlushMode(Compression::FlushMode flush) {
106 int z_flush = 0;

Callers 6

ReadBinaryDataArrayFunction · 0.45
InternReadFileMethod · 0.45
InternReadFileMethod · 0.45
ParseMagicTokenMethod · 0.45
InternReadFileMethod · 0.45
XFileParserMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected