| 905 | } |
| 906 | |
| 907 | static string _buffer_to_string() |
| 908 | { |
| 909 | string s; |
| 910 | for (const int k : Buffer) |
| 911 | { |
| 912 | if (k > 0 && k <= numeric_limits<unsigned char>::max()) |
| 913 | { |
| 914 | char c = static_cast<unsigned char>(k); |
| 915 | if (c == '[' || c == ']') |
| 916 | s += "\\"; |
| 917 | s += c; |
| 918 | } |
| 919 | else |
| 920 | s += make_stringf("[%d]", k); |
| 921 | } |
| 922 | return s; |
| 923 | } |
| 924 | |
| 925 | /* |
| 926 | * Flush the buffer. Later we'll probably want to give the player options |
no test coverage detected