Handles chat-log operations for a single chat room on a server. More...
#include <chatlog.h>
Public Member Functions | |
| ChatLog (const wxString &server, const wxString &room) | |
| Constructor. | |
| ~ChatLog () | |
| Destructor. | |
| bool | AddMessage (const wxString &text) |
| Append a time-stamped message to the log file. | |
| bool | LogEnabled () |
| Check if chat logging is enabled. | |
| wxString | LogTime () |
| Get a string, representing the current time-of-day, suitable for prepending to messages. | |
| void | OpenInEditor () |
| const wxArrayString & | GetLastLines () const |
Protected Member Functions | |
| void | CloseSession () |
| Closes the current "session" in the log file by appending a session-closed notice to end before closing the file. | |
| wxString | GetCurrentLogfilePath () const |
| Get the path (filename) to the current log file. | |
| bool | WriteLine (const wxString &text) |
| Write a line of text to the output file, without any further formatting. | |
| bool | CreateCurrentLogFolder () |
| Create the directory in which the current logfile is saved. | |
| bool | OpenLogFile () |
| void | FillLastLineArray () |
Protected Attributes | |
| wxString | m_server |
| wxString | m_room |
| bool | m_active |
| wxFile | m_logfile |
| wxArrayString | m_last_lines |
Handles chat-log operations for a single chat room on a server.
Definition at line 10 of file chatlog.h.
Constructor.
Prepares the ChatLog to accept log messages for the given chat room or channel on the given server.
| server | Alias or hostname for the server on which the chat room or channel is located. | |
| room | Name of the chat room or channel this object will accept messages for. |
Definition at line 25 of file chatlog.cpp.
| ChatLog::~ChatLog | ( | ) |
Destructor.
Calls CloseSession if the log file is currently opened.
Definition at line 39 of file chatlog.cpp.
| bool ChatLog::AddMessage | ( | const wxString & | text | ) |
Append a time-stamped message to the log file.
Retrieves a time-stamp string from LogTime.
| text | Message text to log. |
false if an error was encountered while writing to the log file, and true otherwise.Definition at line 55 of file chatlog.cpp.
| void ChatLog::CloseSession | ( | ) | [protected] |
Closes the current "session" in the log file by appending a session-closed notice to end before closing the file.
Definition at line 46 of file chatlog.cpp.
| bool ChatLog::CreateCurrentLogFolder | ( | ) | [protected] |
Create the directory in which the current logfile is saved.
true on success, false on failure. Definition at line 71 of file chatlog.cpp.
| void ChatLog::FillLastLineArray | ( | ) | [protected] |
Definition at line 287 of file chatlog.cpp.
| wxString ChatLog::GetCurrentLogfilePath | ( | ) | const [protected] |
Get the path (filename) to the current log file.
Definition at line 144 of file chatlog.cpp.
| const wxArrayString & ChatLog::GetLastLines | ( | ) | const |
Definition at line 138 of file chatlog.cpp.
| bool ChatLog::LogEnabled | ( | ) |
Check if chat logging is enabled.
true if chat logging is enabled, and false if it is not. Definition at line 151 of file chatlog.cpp.
| wxString ChatLog::LogTime | ( | ) |
Get a string, representing the current time-of-day, suitable for prepending to messages.
This is used by AddMessage.
Definition at line 127 of file chatlog.cpp.
| void ChatLog::OpenInEditor | ( | ) |
Definition at line 133 of file chatlog.cpp.
| bool ChatLog::OpenLogFile | ( | ) | [protected] |
Definition at line 100 of file chatlog.cpp.
| bool ChatLog::WriteLine | ( | const wxString & | text | ) | [protected] |
Write a line of text to the output file, without any further formatting.
| text | The line to write. |
true if the line was successfully written, and false otherwise. Definition at line 87 of file chatlog.cpp.
bool ChatLog::m_active [protected] |
wxArrayString ChatLog::m_last_lines [protected] |
wxFile ChatLog::m_logfile [protected] |
wxString ChatLog::m_room [protected] |
wxString ChatLog::m_server [protected] |
1.6.3