mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-11-27 14:37:16 +00:00
shstream:: initialize from a string
This commit is contained in:
parent
b58138cd94
commit
62990a765e
@ -133,7 +133,7 @@ struct fhstream : hstream {
|
|||||||
struct shstream : hstream {
|
struct shstream : hstream {
|
||||||
string s;
|
string s;
|
||||||
int pos;
|
int pos;
|
||||||
shstream() { pos = 0; }
|
shstream(const string& t = "") : s(t) { pos = 0; }
|
||||||
virtual void write_char(char c) { s += c; }
|
virtual void write_char(char c) { s += c; }
|
||||||
virtual char read_char() { if(pos == isize(s)) throw hstream_exception(); return s[pos++]; }
|
virtual char read_char() { if(pos == isize(s)) throw hstream_exception(); return s[pos++]; }
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user