aboutsummaryrefslogtreecommitdiff
path: root/src/streams.h
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2016-12-15 17:15:34 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2016-12-15 17:15:34 +0100
commitaf4c44ce59aa643b3e03eaa121ec075f524227a5 (patch)
tree147b93403350cefebc0a83a5d97bc5522d7381a5 /src/streams.h
parentc6fd923886a3eee01d9e226544b024940038c5e4 (diff)
streams: Add data() method to CDataStream
Analogous to c++11 vector data().
Diffstat (limited to 'src/streams.h')
-rw-r--r--src/streams.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/streams.h b/src/streams.h
index b508784238..3755069982 100644
--- a/src/streams.h
+++ b/src/streams.h
@@ -245,6 +245,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)
{