20 #include <znc/zncconfig.h>
38 const timeval* ts =
nullptr,
74 class CBuffer :
private std::deque<CBufLine> {
86 const timeval* ts =
nullptr,
98 size_type
Size()
const {
return size(); }
CBufLine(const CMessage &Format, const CString &sText="")
bool Equals(const CMessage &Format) const
Definition: Buffer.h:47
void SetTags(const MCString &mssTags)
Definition: Buffer.h:55
void SetText(const CString &sText)
Definition: Buffer.h:53
const MCString & GetTags() const
Definition: Buffer.h:65
CBufLine()
Definition: Buffer.h:32
CString m_sText
Definition: Buffer.h:71
CMessage ToMessage(const CClient &Client, const MCString &mssParams) const
CString GetLine(const CClient &Client, const MCString &mssParams) const
CMessage m_Message
Definition: Buffer.h:70
void SetFormat(const CString &sFormat)
Definition: Buffer.h:52
void SetTime(const timeval &ts)
Definition: Buffer.h:54
CBufLine(const CString &sFormat, const CString &sText="", const timeval *ts=nullptr, const MCString &mssTags=MCString::EmptyMap)
const CString & GetCommand() const
Definition: Buffer.h:59
const CString & GetText() const
Definition: Buffer.h:63
timeval GetTime() const
Definition: Buffer.h:64
CString GetFormat() const
Definition: Buffer.h:60
size_type Size() const
Definition: Buffer.h:98
size_type AddLine(const CString &sFormat, const CString &sText="", const timeval *ts=nullptr, const MCString &mssTags=MCString::EmptyMap)
const CBufLine & GetBufLine(unsigned int uIdx) const
size_type UpdateLine(const CString &sMatch, const CString &sFormat, const CString &sText="")
Same as AddLine, but replaces a line whose format string starts with sMatch if there is one.
bool SetLineCount(unsigned int u, bool bForce=false)
size_type UpdateLine(const CString &sCommand, const CMessage &Format, const CString &sText="")
CString GetLine(size_type uIdx, const CClient &Client, const MCString &msParams=MCString::EmptyMap) const
unsigned int m_uLineCount
Definition: Buffer.h:111
bool IsEmpty() const
Definition: Buffer.h:99
size_type AddLine(const CMessage &Format, const CString &sText="")
unsigned int GetLineCount() const
Definition: Buffer.h:107
void Clear()
Definition: Buffer.h:100
size_type UpdateExactLine(const CMessage &Format, const CString &sText="")
CBuffer(unsigned int uLineCount=100)
size_type UpdateExactLine(const CString &sFormat, const CString &sText="")
Same as UpdateLine, but does nothing if this exact line already exists.
Here is a small explanation of how messages on IRC work, and how you can use this class to get useful...
Definition: Message.h:57
@ ExcludeTags
Definition: Message.h:149
const timeval & GetTime() const
Definition: Message.h:137
void SetTime(const timeval &ts)
Definition: Message.h:138
const MCString & GetTags() const
Definition: Message.h:140
CString ToString(unsigned int uFlags=IncludeAll) const
bool Equals(const CMessage &Other) const
void SetTags(const MCString &mssTags)
Definition: Message.h:141
const CString & GetCommand() const
Definition: Message.h:108
void Parse(const CString &sMessage)
String class that is used inside ZNC.
Definition: ZNCString.h:68
A dictionary for strings.
Definition: ZNCString.h:595
static const MCString EmptyMap
A static instance of an empty map.
Definition: ZNCString.h:606