Treat CDataStream bytes as uint8_t

Also, rename CSerializeData to SerializeData
This commit is contained in:
MarcoFalke
2020-11-23 16:15:50 +01:00
parent fa8bdb048e
commit fada14b948
7 changed files with 25 additions and 41 deletions

View File

@@ -203,7 +203,7 @@ public:
class CDataStream
{
protected:
typedef CSerializeData vector_type;
using vector_type = SerializeData;
vector_type vch;
unsigned int nReadPos;
@@ -266,8 +266,8 @@ public:
const_reference operator[](size_type pos) const { return vch[pos + nReadPos]; }
reference operator[](size_type pos) { return vch[pos + nReadPos]; }
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); }
iterator insert(iterator it, const uint8_t x) { return vch.insert(it, x); }
void insert(iterator it, size_type n, const uint8_t x) { vch.insert(it, n, x); }
value_type* data() { return vch.data() + nReadPos; }
const value_type* data() const { return vch.data() + nReadPos; }