ZNC
trunk
Toggle main menu visibility
Loading...
Searching...
No Matches
include
znc
Query.h
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2004-2025 ZNC, see the NOTICE file for details.
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*/
16
17
#ifndef ZNC_QUERY_H
18
#define ZNC_QUERY_H
19
20
#include <znc/zncconfig.h>
21
#include <
znc/ZNCString.h
>
22
#include <
znc/Buffer.h
>
23
24
// Forward Declarations
25
class
CClient
;
26
class
CIRCNetwork
;
27
// !Forward Declarations
28
29
class
CQuery
{
30
public
:
31
CQuery
(
const
CString
& sName,
CIRCNetwork
* pNetwork);
32
~CQuery
();
33
34
CQuery
(
const
CQuery
&) =
delete
;
35
CQuery
&
operator=
(
const
CQuery
&) =
delete
;
36
37
// Buffer
38
const
CBuffer
&
GetBuffer
()
const
{
return
m_Buffer; }
39
unsigned
int
GetBufferCount
()
const
{
return
m_Buffer.GetLineCount(); }
40
bool
SetBufferCount
(
unsigned
int
u,
bool
bForce =
false
) {
41
return
m_Buffer.SetLineCount(u, bForce);
42
}
43
size_t
AddBuffer
(
const
CMessage
& Format,
const
CString
& sText =
""
) {
44
return
m_Buffer.AddLine(Format, sText);
45
}
46
47
size_t
AddBuffer
(
const
CString
& sFormat,
const
CString
& sText =
""
,
48
const
timeval* ts =
nullptr
,
49
const
MCString
& mssTags =
MCString::EmptyMap
) {
50
return
m_Buffer.AddLine(sFormat, sText, ts, mssTags);
51
}
52
void
ClearBuffer
() { m_Buffer.Clear(); }
53
void
SendBuffer
(
CClient
* pClient);
54
void
SendBuffer
(
CClient
* pClient,
const
CBuffer
& Buffer);
55
// !Buffer
56
57
// Getters
58
const
CString
&
GetName
()
const
{
return
m_sName; }
59
// !Getters
60
61
private
:
62
CString
m_sName;
63
CIRCNetwork
* m_pNetwork;
64
CBuffer
m_Buffer;
65
};
66
67
#endif
// !ZNC_QUERY_H
Buffer.h
ZNCString.h
CBuffer
Definition
Buffer.h:74
CClient
Definition
Client.h:99
CIRCNetwork
Definition
IRCNetwork.h:40
CMessage
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
CQuery::SetBufferCount
bool SetBufferCount(unsigned int u, bool bForce=false)
Definition
Query.h:40
CQuery::~CQuery
~CQuery()
CQuery::operator=
CQuery & operator=(const CQuery &)=delete
CQuery::AddBuffer
size_t AddBuffer(const CString &sFormat, const CString &sText="", const timeval *ts=nullptr, const MCString &mssTags=MCString::EmptyMap)
Definition
Query.h:47
CQuery::GetName
const CString & GetName() const
Definition
Query.h:58
CQuery::SendBuffer
void SendBuffer(CClient *pClient, const CBuffer &Buffer)
CQuery::SendBuffer
void SendBuffer(CClient *pClient)
CQuery::ClearBuffer
void ClearBuffer()
Definition
Query.h:52
CQuery::CQuery
CQuery(const CString &sName, CIRCNetwork *pNetwork)
CQuery::GetBufferCount
unsigned int GetBufferCount() const
Definition
Query.h:39
CQuery::AddBuffer
size_t AddBuffer(const CMessage &Format, const CString &sText="")
Definition
Query.h:43
CQuery::CQuery
CQuery(const CQuery &)=delete
CQuery::GetBuffer
const CBuffer & GetBuffer() const
Definition
Query.h:38
CString
String class that is used inside ZNC.
Definition
ZNCString.h:50
MCString
A dictionary for strings.
Definition
ZNCString.h:577
MCString::EmptyMap
static const MCString EmptyMap
A static instance of an empty map.
Definition
ZNCString.h:588
Generated by
1.17.0