mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-25 01:41:43 +00:00
[ntcore] Fix write_impl (#5847)
The previous fix didn't handle all cases correctly. Instead, add a new function to raw_ostream (SetNumBytesInBuffer) to allow always using the full buffer size, and revamp write_impl to more cleanly handle all cases.
This commit is contained in:
@@ -356,6 +356,11 @@ protected:
|
||||
SetBufferAndMode(BufferStart, Size, BufferKind::ExternalBuffer);
|
||||
}
|
||||
|
||||
/// Force-set the number of bytes in the raw_ostream buffer.
|
||||
void SetNumBytesInBuffer(size_t Size) {
|
||||
OutBufCur = OutBufStart + Size;
|
||||
}
|
||||
|
||||
/// Return an efficient buffer size for the underlying output mechanism.
|
||||
virtual size_t preferred_buffer_size() const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user