Changeset View
Changeset View
Standalone View
Standalone View
src/streams.h
Show First 20 Lines • Show All 216 Lines • ▼ Show 20 Lines | public: | ||||
const_reference operator[](size_type pos) const { | const_reference operator[](size_type pos) const { | ||||
return vch[pos + nReadPos]; | return vch[pos + nReadPos]; | ||||
} | } | ||||
reference operator[](size_type pos) { return vch[pos + nReadPos]; } | reference operator[](size_type pos) { return vch[pos + nReadPos]; } | ||||
void clear() { | void clear() { | ||||
vch.clear(); | vch.clear(); | ||||
nReadPos = 0; | nReadPos = 0; | ||||
} | } | ||||
iterator insert(iterator it, const char &x = char()) { | iterator insert(iterator it, const char x = char()) { | ||||
return vch.insert(it, x); | return vch.insert(it, x); | ||||
} | } | ||||
void insert(iterator it, size_type n, const char &x) { | void insert(iterator it, size_type n, const char x) { | ||||
vch.insert(it, n, x); | vch.insert(it, n, x); | ||||
} | } | ||||
value_type *data() { return vch.data() + nReadPos; } | value_type *data() { return vch.data() + nReadPos; } | ||||
const value_type *data() const { return vch.data() + nReadPos; } | const value_type *data() const { return vch.data() + nReadPos; } | ||||
void insert(iterator it, std::vector<char>::const_iterator first, | void insert(iterator it, std::vector<char>::const_iterator first, | ||||
std::vector<char>::const_iterator last) { | std::vector<char>::const_iterator last) { | ||||
if (last == first) { | if (last == first) { | ||||
▲ Show 20 Lines • Show All 424 Lines • Show Last 20 Lines |