Some output now going through PrintBuffer

This commit is contained in:
2021-10-21 13:15:04 -04:00
parent 458497956d
commit 1a25fed15f
9 changed files with 139 additions and 46 deletions

View File

@@ -96,22 +96,30 @@ private:
// a newline (or any other weird control characters).
void add_line(const char *line, int len);
// Return the line number beyond the end of the buffer.
int last_line() const { return first_line_ + int(lines_.size()); }
// Get the specified line number.
const std::string &nth(int n) const { return lines_[n - first_line_]; }
public:
PrintBuffer(util::WorldType wt);
// Get the current first line.
int first_line() const { return first_line_; }
// Return the line number beyond the end of the buffer.
int last_line() const { return first_line_ + int(lines_.size()); }
// Get the current first unchecked line.
int first_unchecked() const { return first_unchecked_; }
// Get the specified line number.
const std::string &nth(int n) const { return lines_[n - first_line_]; }
// Add a string. If the string doesn't end in a newline, a newline
// is added. The string is broken into lines, and the lines are added
// to the PrintBuffer.
void add_string(const char *text, int len);
void add_string(const std::string &s);
// Discard lines up to but not including line N.
void discard_upto(int n);