MCPcopy Create free account
hub / github.com/assimp/assimp / Read

Method Read

code/Common/ZipArchiveIOSystem.cpp:298–320  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

296
297// ----------------------------------------------------------------
298size_t ZipFile::Read(void *pvBuffer, size_t pSize, size_t pCount) {
299 // Should be impossible
300 ai_assert(m_Buffer != nullptr);
301 ai_assert(nullptr != pvBuffer);
302 ai_assert(0 != pSize);
303 ai_assert(0 != pCount);
304
305 // Clip down to file size
306 size_t byteSize = pSize * pCount;
307 if ((byteSize + m_SeekPtr) > m_Size) {
308 pCount = (m_Size - m_SeekPtr) / pSize;
309 byteSize = pSize * pCount;
310 if (byteSize == 0) {
311 return 0;
312 }
313 }
314
315 std::memcpy(pvBuffer, m_Buffer.get() + m_SeekPtr, byteSize);
316
317 m_SeekPtr += byteSize;
318
319 return pCount;
320}
321
322// ----------------------------------------------------------------
323size_t ZipFile::FileSize() const {

Callers 1

readMethod · 0.45

Calls 1

getMethod · 0.45

Tested by

no test coverage detected