MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / attachStream

Method attachStream

Engine/source/core/util/zip/zipSubStream.cpp:56–87  ·  view source on GitHub ↗

--------------------------------------

Source from the content-addressed store, hash-verified

54
55//--------------------------------------
56bool ZipSubRStream::attachStream(Stream* io_pSlaveStream)
57{
58 AssertFatal(io_pSlaveStream != NULL, "NULL Slave stream?");
59 AssertFatal(m_pStream == NULL, "Already attached!");
60
61 m_pStream = io_pSlaveStream->clone();
62 if (!m_pStream)
63 m_pStream = io_pSlaveStream;
64
65 m_originalSlavePosition = io_pSlaveStream->getPosition();
66 m_uncompressedSize = 0;
67 m_currentPosition = 0;
68 m_EOS = false;
69
70 // Initialize zipStream state...
71 m_pZipStream = new z_stream_s;
72 m_pInputBuffer = new U8[csm_inputBufferSize];
73
74 m_pZipStream->zalloc = Z_NULL;
75 m_pZipStream->zfree = Z_NULL;
76 m_pZipStream->opaque = Z_NULL;
77
78 U32 buffSize = fillBuffer(csm_inputBufferSize);
79
80 m_pZipStream->next_in = m_pInputBuffer;
81 m_pZipStream->avail_in = buffSize;
82 m_pZipStream->total_in = 0;
83 inflateInit2(m_pZipStream, -MAX_WBITS);
84
85 setStatus(Ok);
86 return true;
87}
88
89//--------------------------------------
90void ZipSubRStream::detachStream()

Callers 6

createNewFileMethod · 0.45
openFileForReadMethod · 0.45
extractFileMethod · 0.45

Calls 2

cloneMethod · 0.45
getPositionMethod · 0.45

Tested by

no test coverage detected