// Append chat line
// Removes oldest chat line if scrollback size is reached
- void addLine(std::wstring name, std::wstring text);
+ void addLine(const std::wstring &name, const std::wstring &text);
// Remove all chat lines
void clear();
// Delete lines older than maxAge.
void deleteByAge(f32 maxAge);
- // Get number of columns, 0 if reformat has not been called yet.
- u32 getColumns() const;
// Get number of rows, 0 if reformat has not been called yet.
u32 getRows() const;
// Update console size and reformat all formatted lines.
void input(const std::wstring &str);
// Add a string to the history
- void addToHistory(std::wstring line);
+ void addToHistory(const std::wstring &line);
// Get current line
std::wstring getLine() const { return m_line; }
void clear();
// Replace the current line with the given text
- std::wstring replace(std::wstring line);
+ std::wstring replace(const std::wstring &line);
// Select previous command from history
void historyPrev();
~ChatBackend() = default;
// Add chat message
- void addMessage(std::wstring name, std::wstring text);
+ void addMessage(const std::wstring &name, std::wstring text);
// Parse and add unparsed chat message
void addUnparsedMessage(std::wstring line);
// Get the recent messages buffer
ChatBuffer& getRecentBuffer();
// Concatenate all recent messages
- EnrichedString getRecentChat();
+ EnrichedString getRecentChat() const;
// Get the console prompt
ChatPrompt& getPrompt();
// Resize recent buffer based on settings
void applySettings();
-
+
private:
ChatBuffer m_console_buffer;
ChatBuffer m_recent_buffer;