Implement the abstract native stream using synchronous callbacks.
callbacksRequired virtual methods and optional overrides.
sourceUrlOptionalResource origin; defaults to empty.
modeOptionalNative mode bits; defaults to Read | Write.
Invoke Rml::Stream::Close; memory bytes remain available until shutdown.
Return Rml::Stream::GetSourceURL as text.
Source URL used for relative resources.
Return Rml::Stream::GetStreamMode; new memory streams start at zero.
Native mode bit mask.
Invoke Rml::Stream::IsEOS.
Whether the cursor is at the end.
Invoke Rml::Stream::IsReadReady.
Whether bytes are ready to read.
Check readiness; immutable memory snapshots and files always return false.
Whether bytes can be written now.
Return Rml::Stream::Length in bytes.
Total byte length.
Read through Rml::Stream::Peek without advancing the cursor.
targetMaximum byte count.
Independent bytes without consuming the source.
Peek into a view without advancing the cursor.
targetDestination byte view.
countOptionalByte limit; defaults to view size.
Bytes copied without consuming the source.
Invoke safe Rml::Stream::PopBack with a length-clamped count.
countMaximum bytes to remove.
Actual bytes removed.
Remove front bytes; oversized counts clamp to the stream length.
countMaximum bytes to remove.
Actual bytes removed; memory cursors move back and clamp at zero.
Invoke Rml::Stream::PushBack and restore the previous cursor.
inputUTF-8 text or bytes to append.
Number of bytes appended.
Invoke Rml::Stream::PushFront; memory cursors advance with the insertion.
inputUTF-8 text or bytes to prepend.
Number of bytes prepended.
Read into a view or stream through Rml::Stream::Read.
targetDestination view or stream.
countOptionalByte limit; defaults to view size or remaining length.
Source bytes consumed, even on short destination writes.
Decode consumed UTF-8 bytes and append them to an initial string.
countMaximum byte count.
initialInitial string; defaults to empty.
Appended string, preserving embedded null characters.
Invoke Rml::Stream::Seek with a checked signed integer offset.
offsetByte offset; StreamMemory End subtracts this value.
originSeek base; defaults to Set.
Native success flag; invalid memory targets leave the cursor.
Return Rml::Stream::Tell in bytes.
Current byte position.
Invoke Rml::Stream::Truncate; memory cursors move to the new end.
lengthRequested byte length; larger memory lengths do nothing.
Number of bytes removed.
Invoke Rml::Stream::Write using UTF-8, bytes or another stream.
inputSource; strings preserve embedded null characters.
countOptionalOptional byte limit; defaults to input or remaining size.
Bytes written, or source bytes consumed when copying a stream.
Invoke the native C-string write semantics, stopping at the first null.
inputUTF-8 text.
Bytes written before the first null.
Checked Rml::Stream with native memory, file or synchronous JS storage.
Remarks
Every wrapper expires at shutdown. Returned byte arrays are independent. Byte batches and memory sizes are integers in [0, 2147483647].