ZNC  trunk
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Protected Attributes | Static Private Member Functions | List of all members
CChan Class Reference

#include <Chan.h>

+ Inheritance diagram for CChan:
+ Collaboration diagram for CChan:

Public Types

enum  EUserPerms {
  Voice = '+', HalfOp = '', Op = '@', Admin = '!',
  Owner = '*'
}
 
enum  EModes {
  M_Private = 'p', M_Secret = 's', M_Moderated = 'm', M_InviteOnly = 'i',
  M_NoMessages = 'n', M_OpTopic = 't', M_Limit = 'l', M_Key = 'k',
  M_Op = 'o', M_Voice = 'v', M_Ban = 'b', M_Except = 'e'
}
 

Public Member Functions

 CChan (const CString &sName, CIRCNetwork *pNetwork, bool bInConfig, CConfig *pConfig=nullptr)
 
 ~CChan ()
 
 CChan (const CChan &)=delete
 
CChanoperator= (const CChan &)=delete
 
void Reset ()
 
CConfig ToConfig () const
 
void Clone (CChan &chan)
 
void Cycle () const
 
void JoinUser (const CString &sKey="")
 
void AttachUser (CClient *pClient=nullptr)
 
void DetachUser ()
 
void OnWho (const CString &sNick, const CString &sIdent, const CString &sHost)
 
void SetModes (const CString &s)
 
void ModeChange (const CString &sModes, const CNick *OpNick=nullptr)
 
bool AddMode (char cMode, const CString &sArg)
 
bool RemMode (char cMode)
 
CString GetModeString () const
 
CString GetModeArg (CString &sArgs) const
 
CString GetModeForNames () const
 
void ClearNicks ()
 
const CNickFindNick (const CString &sNick) const
 
CNickFindNick (const CString &sNick)
 
int AddNicks (const CString &sNicks)
 
bool AddNick (const CString &sNick)
 
bool RemNick (const CString &sNick)
 
bool ChangeNick (const CString &sOldNick, const CString &sNewNick)
 
const CBufferGetBuffer () const
 
unsigned int GetBufferCount () const
 
bool SetBufferCount (unsigned int u, bool bForce=false)
 
void InheritBufferCount (unsigned int u, bool bForce=false)
 
void ResetBufferCount ()
 
size_t AddBuffer (const CMessage &Format, const CString &sText="")
 
size_t AddBuffer (const CString &sFormat, const CString &sText="", const timeval *ts=nullptr, const MCString &mssTags=MCString::EmptyMap)
 
void ClearBuffer ()
 
void SendBuffer (CClient *pClient)
 
void SendBuffer (CClient *pClient, const CBuffer &Buffer)
 
CString GetPermStr () const
 e.g. '@' for chanop. More...
 
bool HasPerm (char cPerm) const
 e.g. '@' for chanop. More...
 
bool AddPerm (char cPerm)
 e.g. '@' for chanop. More...
 
bool RemPerm (char cPerm)
 e.g. '@' for chanop. More...
 
void SetModeKnown (bool b)
 
void SetIsOn (bool b)
 
void SetKey (const CString &s)
 
void SetTopic (const CString &s)
 
void SetTopicOwner (const CString &s)
 
void SetTopicDate (unsigned long u)
 
void SetDefaultModes (const CString &s)
 
void SetAutoClearChanBuffer (bool b)
 
void InheritAutoClearChanBuffer (bool b)
 
void ResetAutoClearChanBuffer ()
 
void SetDetached (bool b=true)
 
void SetInConfig (bool b)
 
void SetCreationDate (unsigned long u)
 
void Disable ()
 
void Enable ()
 
void IncJoinTries ()
 
void ResetJoinTries ()
 
CIRCNetworkGetNetwork () const
 
bool IsModeKnown () const
 
bool HasMode (char cMode) const
 
CString GetOptions () const
 
CString GetModeArg (char cMode) const
 
std::map< char, unsigned int > GetPermCounts () const
 
bool IsOn () const
 
const CStringGetName () const
 
const std::map< char, CString > & GetModes () const
 
const CStringGetKey () const
 
const CStringGetTopic () const
 
const CStringGetTopicOwner () const
 
unsigned long GetTopicDate () const
 
const CStringGetDefaultModes () const
 
const std::map< CString, CNick > & GetNicks () const
 
size_t GetNickCount () const
 
bool AutoClearChanBuffer () const
 
bool IsDetached () const
 
bool InConfig () const
 
unsigned long GetCreationDate () const
 
bool IsDisabled () const
 
unsigned int GetJoinTries () const
 
bool HasBufferCountSet () const
 
bool HasAutoClearChanBufferSet () const
 

Protected Attributes

bool m_bDetached
 
bool m_bIsOn
 
bool m_bAutoClearChanBuffer
 
bool m_bInConfig
 
bool m_bDisabled
 
bool m_bHasBufferCountSet
 
bool m_bHasAutoClearChanBufferSet
 
CString m_sName
 
CString m_sKey
 
CString m_sTopic
 
CString m_sTopicOwner
 
unsigned long m_ulTopicDate
 
unsigned long m_ulCreationDate
 
CIRCNetworkm_pNetwork
 
CNick m_Nick
 
unsigned int m_uJoinTries
 
CString m_sDefaultModes
 
std::map< CString, CNickm_msNicks
 
CBuffer m_Buffer
 
bool m_bModeKnown
 
std::map< char, CStringm_mcsModes
 

Static Private Member Functions

static CString t_s (const CString &sEnglish, const CString &sContext="")
 
static CInlineFormatMessage t_f (const CString &sEnglish, const CString &sContext="")
 
static CInlineFormatMessage t_p (const CString &sEnglish, const CString &sEnglishes, int iNum, const CString &sContext="")
 
static CDelayedTranslation t_d (const CString &sEnglish, const CString &sContext="")
 

Member Enumeration Documentation

Enumerator
M_Private 
M_Secret 
M_Moderated 
M_InviteOnly 
M_NoMessages 
M_OpTopic 
M_Limit 
M_Key 
M_Op 
M_Voice 
M_Ban 
M_Except 
Enumerator
Voice 
HalfOp 
Op 
Admin 
Owner 

Constructor & Destructor Documentation

CChan::CChan ( const CString sName,
CIRCNetwork pNetwork,
bool  bInConfig,
CConfig pConfig = nullptr 
)
CChan::~CChan ( )
CChan::CChan ( const CChan )
delete

Member Function Documentation

size_t CChan::AddBuffer ( const CMessage Format,
const CString sText = "" 
)
inline

References CBuffer::AddLine(), and m_Buffer.

size_t CChan::AddBuffer ( const CString sFormat,
const CString sText = "",
const timeval *  ts = nullptr,
const MCString mssTags = MCString::EmptyMap 
)
inline
bool CChan::AddMode ( char  cMode,
const CString sArg 
)
bool CChan::AddNick ( const CString sNick)
int CChan::AddNicks ( const CString sNicks)
bool CChan::AddPerm ( char  cPerm)
inline

e.g. '@' for chanop.

References CNick::AddPerm(), and m_Nick.

void CChan::AttachUser ( CClient pClient = nullptr)
bool CChan::AutoClearChanBuffer ( ) const
inline
bool CChan::ChangeNick ( const CString sOldNick,
const CString sNewNick 
)
void CChan::ClearBuffer ( )
inline

References CBuffer::Clear(), and m_Buffer.

void CChan::ClearNicks ( )
void CChan::Clone ( CChan chan)
void CChan::Cycle ( ) const
void CChan::DetachUser ( )
void CChan::Disable ( )
inline

References m_bDisabled.

void CChan::Enable ( )
const CNick* CChan::FindNick ( const CString sNick) const
CNick* CChan::FindNick ( const CString sNick)
const CBuffer& CChan::GetBuffer ( ) const
inline

References m_Buffer.

unsigned int CChan::GetBufferCount ( ) const
inline
unsigned long CChan::GetCreationDate ( ) const
inline

References m_ulCreationDate.

const CString& CChan::GetDefaultModes ( ) const
inline

References m_sDefaultModes.

unsigned int CChan::GetJoinTries ( ) const
inline

References m_uJoinTries.

const CString& CChan::GetKey ( ) const
inline

References m_sKey.

CString CChan::GetModeArg ( CString sArgs) const
CString CChan::GetModeArg ( char  cMode) const
CString CChan::GetModeForNames ( ) const
const std::map<char, CString>& CChan::GetModes ( ) const
inline

References m_mcsModes.

CString CChan::GetModeString ( ) const
const CString& CChan::GetName ( ) const
inline

References m_sName.

CIRCNetwork* CChan::GetNetwork ( ) const
inline

References m_pNetwork.

size_t CChan::GetNickCount ( ) const
inline

References m_msNicks.

const std::map<CString, CNick>& CChan::GetNicks ( ) const
inline

References m_msNicks.

CString CChan::GetOptions ( ) const
std::map<char, unsigned int> CChan::GetPermCounts ( ) const
CString CChan::GetPermStr ( ) const
inline

e.g. '@' for chanop.

References CNick::GetPermStr(), and m_Nick.

const CString& CChan::GetTopic ( ) const
inline

References m_sTopic.

unsigned long CChan::GetTopicDate ( ) const
inline

References m_ulTopicDate.

const CString& CChan::GetTopicOwner ( ) const
inline

References m_sTopicOwner.

bool CChan::HasAutoClearChanBufferSet ( ) const
inline
bool CChan::HasBufferCountSet ( ) const
inline

References m_bHasBufferCountSet.

bool CChan::HasMode ( char  cMode) const
bool CChan::HasPerm ( char  cPerm) const
inline

e.g. '@' for chanop.

References CNick::HasPerm(), and m_Nick.

void CChan::IncJoinTries ( )
inline

References m_uJoinTries.

bool CChan::InConfig ( ) const
inline

References m_bInConfig.

void CChan::InheritAutoClearChanBuffer ( bool  b)
void CChan::InheritBufferCount ( unsigned int  u,
bool  bForce = false 
)
inline
bool CChan::IsDetached ( ) const
inline

References m_bDetached.

bool CChan::IsDisabled ( ) const
inline

References m_bDisabled.

bool CChan::IsModeKnown ( ) const
inline

References m_bModeKnown.

bool CChan::IsOn ( ) const
inline

References m_bIsOn.

void CChan::JoinUser ( const CString sKey = "")
void CChan::ModeChange ( const CString sModes,
const CNick OpNick = nullptr 
)
void CChan::OnWho ( const CString sNick,
const CString sIdent,
const CString sHost 
)
CChan& CChan::operator= ( const CChan )
delete
bool CChan::RemMode ( char  cMode)
bool CChan::RemNick ( const CString sNick)
bool CChan::RemPerm ( char  cPerm)
inline

e.g. '@' for chanop.

References m_Nick, and CNick::RemPerm().

void CChan::Reset ( )

Referenced by SetIsOn().

void CChan::ResetAutoClearChanBuffer ( )
void CChan::ResetBufferCount ( )
void CChan::ResetJoinTries ( )
inline

References m_uJoinTries.

void CChan::SendBuffer ( CClient pClient)
void CChan::SendBuffer ( CClient pClient,
const CBuffer Buffer 
)
void CChan::SetAutoClearChanBuffer ( bool  b)
bool CChan::SetBufferCount ( unsigned int  u,
bool  bForce = false 
)
inline
void CChan::SetCreationDate ( unsigned long  u)
inline

References m_ulCreationDate.

void CChan::SetDefaultModes ( const CString s)
inline

References m_sDefaultModes.

void CChan::SetDetached ( bool  b = true)
inline

References m_bDetached.

void CChan::SetInConfig ( bool  b)
void CChan::SetIsOn ( bool  b)
inline

References m_bIsOn, and Reset().

void CChan::SetKey ( const CString s)
void CChan::SetModeKnown ( bool  b)
inline

References m_bModeKnown.

void CChan::SetModes ( const CString s)
void CChan::SetTopic ( const CString s)
inline

References m_sTopic.

void CChan::SetTopicDate ( unsigned long  u)
inline

References m_ulTopicDate.

void CChan::SetTopicOwner ( const CString s)
inline

References m_sTopicOwner.

CConfig CChan::ToConfig ( ) const

Member Data Documentation

bool CChan::m_bAutoClearChanBuffer
protected

Referenced by AutoClearChanBuffer().

bool CChan::m_bDetached
protected

Referenced by IsDetached(), and SetDetached().

bool CChan::m_bDisabled
protected

Referenced by Disable(), and IsDisabled().

bool CChan::m_bHasAutoClearChanBufferSet
protected
bool CChan::m_bHasBufferCountSet
protected
bool CChan::m_bInConfig
protected

Referenced by InConfig().

bool CChan::m_bIsOn
protected

Referenced by IsOn(), and SetIsOn().

bool CChan::m_bModeKnown
protected

Referenced by IsModeKnown(), and SetModeKnown().

CBuffer CChan::m_Buffer
protected
std::map<char, CString> CChan::m_mcsModes
protected

Referenced by GetModes().

std::map<CString, CNick> CChan::m_msNicks
protected

Referenced by GetNickCount(), and GetNicks().

CNick CChan::m_Nick
protected

Referenced by AddPerm(), GetPermStr(), HasPerm(), and RemPerm().

CIRCNetwork* CChan::m_pNetwork
protected

Referenced by GetNetwork().

CString CChan::m_sDefaultModes
protected

Referenced by GetDefaultModes(), and SetDefaultModes().

CString CChan::m_sKey
protected

Referenced by GetKey().

CString CChan::m_sName
protected

Referenced by GetName().

CString CChan::m_sTopic
protected

Referenced by GetTopic(), and SetTopic().

CString CChan::m_sTopicOwner
protected

Referenced by GetTopicOwner(), and SetTopicOwner().

unsigned int CChan::m_uJoinTries
protected
unsigned long CChan::m_ulCreationDate
protected

Referenced by GetCreationDate(), and SetCreationDate().

unsigned long CChan::m_ulTopicDate
protected

Referenced by GetTopicDate(), and SetTopicDate().


The documentation for this class was generated from the following file: