Minimal stream for overwriting and/or appending to an existing byte vector.
More...
#include <streams.h>
|
| | VectorWriter (std::vector< uint8_t > &vchDataIn, size_t nPosIn) |
| |
| template<typename... Args> |
| | VectorWriter (std::vector< uint8_t > &vchDataIn, size_t nPosIn, Args &&...args) |
| | (other params same as above) More...
|
| |
| void | write (Span< const std::byte > src) |
| |
| template<typename T > |
| VectorWriter & | operator<< (const T &obj) |
| |
Minimal stream for overwriting and/or appending to an existing byte vector.
The referenced vector will grow as necessary.
Definition at line 31 of file streams.h.
◆ VectorWriter() [1/2]
| VectorWriter::VectorWriter |
( |
std::vector< uint8_t > & |
vchDataIn, |
|
|
size_t |
nPosIn |
|
) |
| |
|
inline |
- Parameters
-
| [in] | vchDataIn | Referenced byte vector to overwrite/append |
| [in] | nPosIn | Starting position. Vector index where writes should start. The vector will initially grow as necessary to max(nPosIn, vec.size()). So to append, use vec.size(). |
Definition at line 39 of file streams.h.
◆ VectorWriter() [2/2]
template<typename... Args>
| VectorWriter::VectorWriter |
( |
std::vector< uint8_t > & |
vchDataIn, |
|
|
size_t |
nPosIn, |
|
|
Args &&... |
args |
|
) |
| |
|
inline |
(other params same as above)
- Parameters
-
| [in] | args | A list of items to serialize starting at nPosIn. |
Definition at line 50 of file streams.h.
◆ operator<<()
◆ write()
| void VectorWriter::write |
( |
Span< const std::byte > |
src | ) |
|
|
inline |
◆ nPos
| size_t VectorWriter::nPos |
|
private |
◆ vchData
| std::vector<uint8_t>& VectorWriter::vchData |
|
private |
The documentation for this class was generated from the following file: