ZNC trunk
Loading...
Searching...
No Matches
Server.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_SERVER_H
18#define ZNC_SERVER_H
19
20#include <znc/zncconfig.h>
21#include <znc/ZNCString.h>
22
23class CServer {
24 public:
25 CServer(const CString& sName, unsigned short uPort = 6667,
26 const CString& sPass = "", bool bSSL = false,
27 bool bUnixSocket = false);
29
30 // TODO: use C++20's =default and <=>
31 bool operator==(const CServer&) const;
32 bool operator<(const CServer&) const;
33
34 static CServer Parse(CString sLine);
35
36 const CString& GetName() const;
37 unsigned short GetPort() const;
38 const CString& GetPass() const;
39 bool IsSSL() const;
40 bool IsUnixSocket() const;
41 CString GetString(bool bIncludePassword = true) const;
42 static bool IsValidHostName(const CString& sHostName);
43
44 private:
45 protected:
47 unsigned short m_uPort;
49 bool m_bSSL;
51};
52
53#endif // !ZNC_SERVER_H
Definition Server.h:23
CString m_sName
Definition Server.h:46
CServer(const CString &sName, unsigned short uPort=6667, const CString &sPass="", bool bSSL=false, bool bUnixSocket=false)
const CString & GetName() const
CString GetString(bool bIncludePassword=true) const
bool IsSSL() const
bool operator==(const CServer &) const
static bool IsValidHostName(const CString &sHostName)
static CServer Parse(CString sLine)
bool operator<(const CServer &) const
unsigned short GetPort() const
bool m_bSSL
Definition Server.h:49
bool IsUnixSocket() const
unsigned short m_uPort
Definition Server.h:47
bool m_bUnixSocket
Definition Server.h:50
CString m_sPass
Definition Server.h:48
const CString & GetPass() const
String class that is used inside ZNC.
Definition ZNCString.h:50