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

Method SetReadLimit

include/assimp/StreamReader.h:265–277  ·  view source on GitHub ↗

--------------------------------------------------------------------- Setup a temporary read limit * * @param _limit Maximum number of bytes to be read from * the beginning of the file. Specifying UINT_MAX * resets the limit to the original end of the stream. * @return The previously set limit. */

Source from the content-addressed store, hash-verified

263 * resets the limit to the original end of the stream.
264 * @return The previously set limit. */
265 unsigned int SetReadLimit(unsigned int _limit) {
266 unsigned int prev = GetReadLimit();
267 if (UINT_MAX == _limit) {
268 mLimit = mEnd;
269 return prev;
270 }
271
272 mLimit = mBuffer + _limit;
273 if (mLimit > mEnd) {
274 throw DeadlyImportError("StreamReader: Invalid read limit");
275 }
276 return prev;
277 }
278
279 // ---------------------------------------------------------------------
280 /** Get the current read limit in bytes. Reading over this limit

Callers 4

ReadShapeFunction · 0.80
ReadLightFunction · 0.80
ReadInstanceFunction · 0.80
ReadSceneFunction · 0.80

Calls 1

DeadlyImportErrorFunction · 0.85

Tested by

no test coverage detected