ZNC  trunk
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Nick.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2004-2014 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 _NICK_H
18 #define _NICK_H
19 
20 #include <znc/zncconfig.h>
21 #include <znc/ZNCString.h>
22 #include <vector>
23 
24 // Forward Decl
25 class CIRCNetwork;
26 class CChan;
27 // !Forward Decl
28 
29 class CNick
30 {
31 public:
32  CNick();
33  CNick(const CString& sNick);
34  ~CNick();
35 
36  void Reset();
37  void Parse(const CString& sNickMask);
38  CString GetHostMask() const;
39  size_t GetCommonChans(std::vector<CChan*>& vChans, CIRCNetwork* pNetwork) const;
40  bool NickEquals(const CString& nickname) const;
41 
42  // Setters
43  void SetNetwork(CIRCNetwork* pNetwork);
44  void SetNick(const CString& s);
45  void SetIdent(const CString& s);
46  void SetHost(const CString& s);
47  bool AddPerm(unsigned char uPerm);
48  bool RemPerm(unsigned char uPerm);
49  // !Setters
50 
51  // Getters
52  CString GetPermStr() const;
53  unsigned char GetPermChar() const;
54  bool HasPerm(unsigned char uPerm) const;
55  const CString& GetNick() const;
56  const CString& GetIdent() const;
57  const CString& GetHost() const;
58  CString GetNickMask() const;
59  // !Getters
60 
61  void Clone(const CNick& SourceNick);
62 private:
63 protected:
69 };
70 
71 #endif // !_NICK_H
bool RemPerm(unsigned char uPerm)
void SetNetwork(CIRCNetwork *pNetwork)
CString m_sNick
Definition: Nick.h:66
size_t GetCommonChans(std::vector< CChan * > &vChans, CIRCNetwork *pNetwork) const
CString m_sHost
Definition: Nick.h:68
CString m_sChanPerms
Definition: Nick.h:64
const CString & GetNick() const
const CString & GetIdent() const
Definition: Nick.h:29
bool NickEquals(const CString &nickname) const
void SetNick(const CString &s)
CString GetNickMask() const
Definition: IRCNetwork.h:36
CString m_sIdent
Definition: Nick.h:67
String class that is used inside ZNC.
Definition: ZNCString.h:67
void Reset()
void Parse(const CString &sNickMask)
bool AddPerm(unsigned char uPerm)
bool HasPerm(unsigned char uPerm) const
CIRCNetwork * m_pNetwork
Definition: Nick.h:65
void SetHost(const CString &s)
void Clone(const CNick &SourceNick)
void SetIdent(const CString &s)
CString GetHostMask() const
const CString & GetHost() const
CString GetPermStr() const
unsigned char GetPermChar() const
Definition: Chan.h:34