streams: Add data() method to CDataStream

Analogous to c++11 vector data().

(cherry picked from commit af4c44ce59aa643b3e03eaa121ec075f524227a5)
This commit is contained in:
Wladimir J. van der Laan 2016-12-15 17:15:34 +01:00 committed by Jack Grigg
parent 1249659a3b
commit 336d0e3be5
1 changed files with 2 additions and 0 deletions

View File

@ -177,6 +177,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)
{