mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2026-11-17 13:14:30 +00:00
shstream:: initialize from a string
This commit is contained in:
1 parent
b58138cd94
commit
62990a765e
1 file changed
+1
-1
+1
-1
@@ -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++]; }
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user