Changeset View
Changeset View
Standalone View
Standalone View
src/streams.h
Show First 20 Lines • Show All 62 Lines • ▼ Show 20 Lines | |||||
*/ | */ | ||||
class CVectorWriter { | class CVectorWriter { | ||||
public: | public: | ||||
/** | /** | ||||
* @param[in] nTypeIn Serialization Type | * @param[in] nTypeIn Serialization Type | ||||
* @param[in] nVersionIn Serialization Version (including any flags) | * @param[in] nVersionIn Serialization Version (including any flags) | ||||
* @param[in] vchDataIn Referenced byte vector to overwrite/append | * @param[in] vchDataIn Referenced byte vector to overwrite/append | ||||
* @param[in] nPosIn Starting position. Vector index where writes should | * @param[in] nPosIn Starting position. Vector index where writes should | ||||
* start. The vector will initially grow as necessary to max(index, | * start. The vector will initially grow as necessary to max(index, | ||||
* vec.size()). So to append, use vec.size(). | * vec.size()). So to append, use vec.size(). | ||||
*/ | */ | ||||
CVectorWriter(int nTypeIn, int nVersionIn, std::vector<uint8_t> &vchDataIn, | CVectorWriter(int nTypeIn, int nVersionIn, std::vector<uint8_t> &vchDataIn, | ||||
size_t nPosIn) | size_t nPosIn) | ||||
: nType(nTypeIn), nVersion(nVersionIn), vchData(vchDataIn), | : nType(nTypeIn), nVersion(nVersionIn), vchData(vchDataIn), | ||||
nPos(nPosIn) { | nPos(nPosIn) { | ||||
if (nPos > vchData.size()) vchData.resize(nPos); | if (nPos > vchData.size()) vchData.resize(nPos); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 741 Lines • Show Last 20 Lines |