mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-11-23 21:07:17 +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 {
|
||||
string s;
|
||||
int pos;
|
||||
shstream() { pos = 0; }
|
||||
shstream(const string& t = "") : s(t) { pos = 0; }
|
||||
virtual void write_char(char c) { s += c; }
|
||||
virtual char read_char() { if(pos == isize(s)) throw hstream_exception(); return s[pos++]; }
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user