[#DataStream] = DataStream :mrdocs: Double ended buffer combining vector and stream‐like interfaces. == Synopsis Declared in `<streams.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- class DataStream; ---- == Description >> and << read and write unformatted data using the above serialization templates. Fills with data in linear time; some stringstream implementations take Nˆ2 time. == Type Aliases [cols="1,4"] |=== | Name| Description | xref:DataStream/allocator_type.adoc[`allocator_type`] | Allocator type of the underlying container. | xref:DataStream/const_iterator.adoc[`const_iterator`] | Const iterator over the stream's elements. | xref:DataStream/const_reference.adoc[`const_reference`] | Const reference to an element of the stream. | xref:DataStream/difference_type.adoc[`difference_type`] | Signed difference type of the underlying container. | xref:DataStream/iterator.adoc[`iterator`] | Mutable iterator over the stream's elements. | xref:DataStream/reference.adoc[`reference`] | Reference to an element of the stream. | xref:DataStream/reverse_iterator.adoc[`reverse_iterator`] | Reverse iterator over the stream's elements. | xref:DataStream/size_type.adoc[`size_type`] | Unsigned size type of the underlying container. | xref:DataStream/value_type.adoc[`value_type`] | Element type stored in the stream. |=== == Member Functions [cols="1,4"] |=== | Name| Description | xref:DataStream/2constructor-031.adoc[`DataStream`] [.small]#[constructor]# | Constructors | xref:DataStream/GetMemoryUsage.adoc[`GetMemoryUsage`] | Compute total memory usage of this object (own memory + any dynamic memory). | xref:DataStream/begin-0d.adoc[`begin`] | `begin` overloads | xref:DataStream/clear.adoc[`clear`] | Empty the stream and reset the read position. | xref:DataStream/data-098.adoc[`data`] | `data` overloads | xref:DataStream/empty.adoc[`empty`] | Return true if no unread elements remain. | xref:DataStream/end-0e.adoc[`end`] | `end` overloads | xref:DataStream/ignore.adoc[`ignore`] | Skip `num_ignore` bytes from the front of the stream, advancing the read position. | xref:DataStream/operator_rshift.adoc[`operator>>`] | Deserialize an object from the front of the stream and return this stream. | xref:DataStream/operator_subs-0e.adoc[`operator[]`] | Subscript operators | xref:DataStream/read.adoc[`read`] | Read bytes from the front of the stream into `dst`, advancing the read position. | xref:DataStream/reserve.adoc[`reserve`] | Reserve capacity for `n` unread elements. | xref:DataStream/resize.adoc[`resize`] | Resize the unread region to `n` elements, filling new ones with `c`. | xref:DataStream/size.adoc[`size`] | Return the number of unread elements. | xref:DataStream/str.adoc[`str`] | Return the unread contents of the stream as a std::string. | xref:DataStream/write.adoc[`write`] | Append a buffer of bytes to the end of the stream. | xref:DataStream/operator_lshift.adoc[`operator<<`] | Serialize an object to the end of the stream and return this stream. |=== == Protected Type Aliases [cols="1,4"] |=== | Name| Description | xref:DataStream/vector_type.adoc[`vector_type`] | Underlying byte container type backing the stream. |=== == Protected Data Members [cols="1,4"] |=== | Name| Description | xref:DataStream/m_read_pos.adoc[`m_read_pos`] | Offset of the first unread byte within vch. | xref:DataStream/vch.adoc[`vch`] | Backing buffer holding both already‐read and unread bytes. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#