mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-05 10:12:48 +01:00
Merge #9353: Add data() method to CDataStream (and use it)
5113474wallet: Use CDataStream.data() (Wladimir J. van der Laan)e2300ffbench: Use CDataStream.data() (Wladimir J. van der Laan)adff950dbwrapper: Use new .data() method of CDataStream (Wladimir J. van der Laan)a2141e4streams: Remove special cases for ancient MSVC (Wladimir J. van der Laan)af4c44cstreams: Add data() method to CDataStream (Wladimir J. van der Laan)
This commit is contained in:
@@ -174,12 +174,10 @@ public:
|
||||
Init(nTypeIn, nVersionIn);
|
||||
}
|
||||
|
||||
#if !defined(_MSC_VER) || _MSC_VER >= 1300
|
||||
CDataStream(const char* pbegin, const char* pend, int nTypeIn, int nVersionIn) : vch(pbegin, pend)
|
||||
{
|
||||
Init(nTypeIn, nVersionIn);
|
||||
}
|
||||
#endif
|
||||
|
||||
CDataStream(const vector_type& vchIn, int nTypeIn, int nVersionIn) : vch(vchIn.begin(), vchIn.end())
|
||||
{
|
||||
@@ -245,6 +243,8 @@ public:
|
||||
void clear() { vch.clear(); nReadPos = 0; }
|
||||
iterator insert(iterator it, const char& x=char()) { return vch.insert(it, x); }
|
||||
void insert(iterator it, size_type n, const char& x) { vch.insert(it, n, x); }
|
||||
value_type* data() { return vch.data() + nReadPos; }
|
||||
const value_type* data() const { return vch.data() + nReadPos; }
|
||||
|
||||
void insert(iterator it, std::vector<char>::const_iterator first, std::vector<char>::const_iterator last)
|
||||
{
|
||||
@@ -259,7 +259,6 @@ public:
|
||||
vch.insert(it, first, last);
|
||||
}
|
||||
|
||||
#if !defined(_MSC_VER) || _MSC_VER >= 1300
|
||||
void insert(iterator it, const char* first, const char* last)
|
||||
{
|
||||
assert(last - first >= 0);
|
||||
@@ -272,7 +271,6 @@ public:
|
||||
else
|
||||
vch.insert(it, first, last);
|
||||
}
|
||||
#endif
|
||||
|
||||
iterator erase(iterator it)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user