We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 5e67010 + cd98157 commit 8256505Copy full SHA for 8256505
utility/common.cpp
@@ -430,6 +430,12 @@ namespace std
430
throw runtime_error("not impl");
431
}
432
433
+ void FStream::ensure_size(size_t s)
434
+ {
435
+ if (s > m_Remaining)
436
+ throw runtime_error("underflow");
437
+ }
438
+
439
size_t FStream::read(void* pPtr, size_t nSize)
440
{
441
m_F.read((char*)pPtr, nSize);
utility/common.h
@@ -269,6 +269,7 @@ namespace std
269
void Seek(uint64_t);
270
uint64_t Tell();
271
272
+ void ensure_size(size_t s);
273
// read/write always return the size requested. Exception is thrown if underflow or error
274
size_t read(void* pPtr, size_t nSize);
275
size_t write(const void* pPtr, size_t nSize);
0 commit comments