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

#include <IRCNetwork.h>

+ Inheritance diagram for CIRCNetwork:
+ Collaboration diagram for CIRCNetwork:

Public Member Functions

 CIRCNetwork (CUser *pUser, const CString &sName)
 
 CIRCNetwork (CUser *pUser, const CIRCNetwork &Network)
 
 ~CIRCNetwork ()
 
 CIRCNetwork (const CIRCNetwork &)=delete
 
CIRCNetworkoperator= (const CIRCNetwork &)=delete
 
void Clone (const CIRCNetwork &Network, bool bCloneName=true)
 
CString GetNetworkPath () const
 
void DelServers ()
 
bool ParseConfig (CConfig *pConfig, CString &sError, bool bUpgrade=false)
 
CConfig ToConfig () const
 
void BounceAllClients ()
 
bool IsUserAttached () const
 
bool IsUserOnline () const
 
void ClientConnected (CClient *pClient)
 
void ClientDisconnected (CClient *pClient)
 
CUserGetUser () const
 
const CStringGetName () const
 
bool IsNetworkAttached () const
 
const std::vector< CClient * > & GetClients () const
 
std::vector< CClient * > FindClients (const CString &sIdentifier) const
 
void SetUser (CUser *pUser)
 
bool SetName (const CString &sName)
 
CModulesGetModules ()
 
const CModulesGetModules () const
 
bool PutUser (const CString &sLine, CClient *pClient=nullptr, CClient *pSkipClient=nullptr)
 
bool PutUser (const CMessage &Message, CClient *pClient=nullptr, CClient *pSkipClient=nullptr)
 
bool PutStatus (const CString &sLine, CClient *pClient=nullptr, CClient *pSkipClient=nullptr)
 
bool PutModule (const CString &sModule, const CString &sLine, CClient *pClient=nullptr, CClient *pSkipClient=nullptr)
 
const std::vector< CChan * > & GetChans () const
 
CChanFindChan (CString sName) const
 
std::vector< CChan * > FindChans (const CString &sWild) const
 
bool AddChan (CChan *pChan)
 
bool AddChan (const CString &sName, bool bInConfig)
 
bool DelChan (const CString &sName)
 
void JoinChans ()
 
void JoinChans (std::set< CChan * > &sChans)
 
const std::vector< CQuery * > & GetQueries () const
 
CQueryFindQuery (const CString &sName) const
 
std::vector< CQuery * > FindQueries (const CString &sWild) const
 
CQueryAddQuery (const CString &sName)
 
bool DelQuery (const CString &sName)
 
const CStringGetChanPrefixes () const
 
void SetChanPrefixes (const CString &s)
 
bool IsChan (const CString &sChan) const
 
const std::vector< CServer * > & GetServers () const
 
bool HasServers () const
 
CServerFindServer (const CString &sName) const
 
bool DelServer (const CString &sName, unsigned short uPort, const CString &sPass)
 
bool AddServer (const CString &sName)
 
bool AddServer (const CString &sName, unsigned short uPort, const CString &sPass="", bool bSSL=false)
 
CServerGetNextServer (bool bAdvance=true)
 
CServerGetCurrentServer () const
 
void SetIRCServer (const CString &s)
 
bool SetNextServer (const CServer *pServer)
 
bool IsLastServer () const
 
const SCStringGetTrustedFingerprints () const
 
void AddTrustedFingerprint (const CString &sFP)
 
void DelTrustedFingerprint (const CString &sFP)
 
void ClearTrustedFingerprints ()
 
void SetIRCConnectEnabled (bool b)
 
bool GetIRCConnectEnabled () const
 
CIRCSockGetIRCSock ()
 
const CIRCSockGetIRCSock () const
 
const CStringGetIRCServer () const
 
const CNickGetIRCNick () const
 
void SetIRCNick (const CNick &n)
 
CString GetCurNick () const
 
bool IsIRCAway () const
 
void SetIRCAway (bool b)
 
bool Connect ()
 
bool IsIRCConnected () const
 This method will return whether the user is connected and authenticated to an IRC server. More...
 
void SetIRCSocket (CIRCSock *pIRCSock)
 
void IRCConnected ()
 
void IRCDisconnected ()
 
void CheckIRCConnect ()
 
bool PutIRC (const CString &sLine)
 
bool PutIRC (const CMessage &Message)
 
void AddRawBuffer (const CMessage &Format, const CString &sText="")
 
void UpdateRawBuffer (const CString &sCommand, const CMessage &Format, const CString &sText="")
 
void UpdateExactRawBuffer (const CMessage &Format, const CString &sText="")
 
void ClearRawBuffer ()
 
void AddRawBuffer (const CString &sFormat, const CString &sText="")
 
void UpdateRawBuffer (const CString &sMatch, const CString &sFormat, const CString &sText="")
 
void UpdateExactRawBuffer (const CString &sFormat, const CString &sText="")
 
void AddMotdBuffer (const CMessage &Format, const CString &sText="")
 
void UpdateMotdBuffer (const CString &sCommand, const CMessage &Format, const CString &sText="")
 
void ClearMotdBuffer ()
 
void AddMotdBuffer (const CString &sFormat, const CString &sText="")
 
void UpdateMotdBuffer (const CString &sMatch, const CString &sFormat, const CString &sText="")
 
void AddNoticeBuffer (const CMessage &Format, const CString &sText="")
 
void UpdateNoticeBuffer (const CString &sCommand, const CMessage &Format, const CString &sText="")
 
void ClearNoticeBuffer ()
 
void AddNoticeBuffer (const CString &sFormat, const CString &sText="")
 
void UpdateNoticeBuffer (const CString &sMatch, const CString &sFormat, const CString &sText="")
 
void ClearQueryBuffer ()
 
const CStringGetNick (const bool bAllowDefault=true) const
 
const CStringGetAltNick (const bool bAllowDefault=true) const
 
const CStringGetIdent (const bool bAllowDefault=true) const
 
CString GetRealName () const
 
const CStringGetBindHost () const
 
const CStringGetEncoding () const
 
CString GetQuitMsg () const
 
void SetNick (const CString &s)
 
void SetAltNick (const CString &s)
 
void SetIdent (const CString &s)
 
void SetRealName (const CString &s)
 
void SetBindHost (const CString &s)
 
void SetEncoding (const CString &s)
 
void SetQuitMsg (const CString &s)
 
double GetFloodRate () const
 
unsigned short int GetFloodBurst () const
 
void SetFloodRate (double fFloodRate)
 
void SetFloodBurst (unsigned short int uFloodBurst)
 
unsigned short int GetJoinDelay () const
 
void SetJoinDelay (unsigned short int uJoinDelay)
 
void SetTrustAllCerts (const bool bTrustAll=false)
 
bool GetTrustAllCerts () const
 
void SetTrustPKI (const bool bTrustPKI=true)
 
bool GetTrustPKI () const
 
unsigned long long BytesRead () const
 
unsigned long long BytesWritten () const
 
void AddBytesRead (unsigned long long u)
 
void AddBytesWritten (unsigned long long u)
 
CString ExpandString (const CString &sStr) const
 
CStringExpandString (const CString &sStr, CString &sRet) const
 

Static Public Member Functions

static bool IsValidNetwork (const CString &sNetwork)
 

Protected Attributes

CString m_sName
 
CUserm_pUser
 
CString m_sNick
 
CString m_sAltNick
 
CString m_sIdent
 
CString m_sRealName
 
CString m_sBindHost
 
CString m_sEncoding
 
CString m_sQuitMsg
 
SCString m_ssTrustedFingerprints
 
CModulesm_pModules
 
std::vector< CClient * > m_vClients
 
CIRCSockm_pIRCSock
 
std::vector< CChan * > m_vChans
 
std::vector< CQuery * > m_vQueries
 
CString m_sChanPrefixes
 
bool m_bIRCConnectEnabled
 
bool m_bTrustAllCerts
 
bool m_bTrustPKI
 
CString m_sIRCServer
 
std::vector< CServer * > m_vServers
 
size_t m_uServerIdx
 Index in m_vServers of our current server + 1. More...
 
CNick m_IRCNick
 
bool m_bIRCAway
 
double m_fFloodRate
 Set to -1 to disable protection. More...
 
unsigned short int m_uFloodBurst
 
CBuffer m_RawBuffer
 
CBuffer m_MotdBuffer
 
CBuffer m_NoticeBuffer
 
CIRCNetworkPingTimer * m_pPingTimer
 
CIRCNetworkJoinTimer * m_pJoinTimer
 
unsigned short int m_uJoinDelay
 
unsigned long long m_uBytesRead
 
unsigned long long m_uBytesWritten
 

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="")
 

Constructor & Destructor Documentation

CIRCNetwork::CIRCNetwork ( CUser pUser,
const CString sName 
)
CIRCNetwork::CIRCNetwork ( CUser pUser,
const CIRCNetwork Network 
)
CIRCNetwork::~CIRCNetwork ( )
CIRCNetwork::CIRCNetwork ( const CIRCNetwork )
delete

Member Function Documentation

void CIRCNetwork::AddBytesRead ( unsigned long long  u)
inline

References m_uBytesRead.

void CIRCNetwork::AddBytesWritten ( unsigned long long  u)
inline

References m_uBytesWritten.

bool CIRCNetwork::AddChan ( CChan pChan)
bool CIRCNetwork::AddChan ( const CString sName,
bool  bInConfig 
)
void CIRCNetwork::AddMotdBuffer ( const CMessage Format,
const CString sText = "" 
)
inline

References CBuffer::AddLine(), and m_MotdBuffer.

void CIRCNetwork::AddMotdBuffer ( const CString sFormat,
const CString sText = "" 
)
inline
void CIRCNetwork::AddNoticeBuffer ( const CMessage Format,
const CString sText = "" 
)
inline
void CIRCNetwork::AddNoticeBuffer ( const CString sFormat,
const CString sText = "" 
)
inline
CQuery* CIRCNetwork::AddQuery ( const CString sName)
void CIRCNetwork::AddRawBuffer ( const CMessage Format,
const CString sText = "" 
)
inline

References CBuffer::AddLine(), and m_RawBuffer.

void CIRCNetwork::AddRawBuffer ( const CString sFormat,
const CString sText = "" 
)
inline
bool CIRCNetwork::AddServer ( const CString sName)
bool CIRCNetwork::AddServer ( const CString sName,
unsigned short  uPort,
const CString sPass = "",
bool  bSSL = false 
)
void CIRCNetwork::AddTrustedFingerprint ( const CString sFP)
inline
void CIRCNetwork::BounceAllClients ( )
unsigned long long CIRCNetwork::BytesRead ( ) const
inline

References m_uBytesRead.

unsigned long long CIRCNetwork::BytesWritten ( ) const
inline

References m_uBytesWritten.

void CIRCNetwork::CheckIRCConnect ( )
void CIRCNetwork::ClearMotdBuffer ( )
inline

References CBuffer::Clear(), and m_MotdBuffer.

void CIRCNetwork::ClearNoticeBuffer ( )
inline

References CBuffer::Clear(), and m_NoticeBuffer.

void CIRCNetwork::ClearQueryBuffer ( )
void CIRCNetwork::ClearRawBuffer ( )
inline

References CBuffer::Clear(), and m_RawBuffer.

void CIRCNetwork::ClearTrustedFingerprints ( )
inline
void CIRCNetwork::ClientConnected ( CClient pClient)
void CIRCNetwork::ClientDisconnected ( CClient pClient)
void CIRCNetwork::Clone ( const CIRCNetwork Network,
bool  bCloneName = true 
)
bool CIRCNetwork::Connect ( )
bool CIRCNetwork::DelChan ( const CString sName)
bool CIRCNetwork::DelQuery ( const CString sName)
bool CIRCNetwork::DelServer ( const CString sName,
unsigned short  uPort,
const CString sPass 
)
void CIRCNetwork::DelServers ( )
void CIRCNetwork::DelTrustedFingerprint ( const CString sFP)
inline
CString CIRCNetwork::ExpandString ( const CString sStr) const
CString& CIRCNetwork::ExpandString ( const CString sStr,
CString sRet 
) const
CChan* CIRCNetwork::FindChan ( CString  sName) const
std::vector<CChan*> CIRCNetwork::FindChans ( const CString sWild) const
std::vector<CClient*> CIRCNetwork::FindClients ( const CString sIdentifier) const
std::vector<CQuery*> CIRCNetwork::FindQueries ( const CString sWild) const
CQuery* CIRCNetwork::FindQuery ( const CString sName) const
CServer* CIRCNetwork::FindServer ( const CString sName) const
const CString& CIRCNetwork::GetAltNick ( const bool  bAllowDefault = true) const
const CString& CIRCNetwork::GetBindHost ( ) const
const CString& CIRCNetwork::GetChanPrefixes ( ) const
inline

References m_sChanPrefixes.

const std::vector<CChan*>& CIRCNetwork::GetChans ( ) const
const std::vector<CClient*>& CIRCNetwork::GetClients ( ) const
inline

References m_vClients.

CString CIRCNetwork::GetCurNick ( ) const
CServer* CIRCNetwork::GetCurrentServer ( ) const
const CString& CIRCNetwork::GetEncoding ( ) const
unsigned short int CIRCNetwork::GetFloodBurst ( ) const
inline

References m_uFloodBurst.

double CIRCNetwork::GetFloodRate ( ) const
inline

References m_fFloodRate.

const CString& CIRCNetwork::GetIdent ( const bool  bAllowDefault = true) const
bool CIRCNetwork::GetIRCConnectEnabled ( ) const
inline

References m_bIRCConnectEnabled.

const CNick& CIRCNetwork::GetIRCNick ( ) const
const CString& CIRCNetwork::GetIRCServer ( ) const
CIRCSock* CIRCNetwork::GetIRCSock ( )
inline

References m_pIRCSock.

const CIRCSock* CIRCNetwork::GetIRCSock ( ) const
inline

References m_pIRCSock.

unsigned short int CIRCNetwork::GetJoinDelay ( ) const
inline

References m_uJoinDelay.

CModules& CIRCNetwork::GetModules ( )
inline

References m_pModules.

const CModules& CIRCNetwork::GetModules ( ) const
inline

References m_pModules.

const CString& CIRCNetwork::GetName ( ) const
CString CIRCNetwork::GetNetworkPath ( ) const
CServer* CIRCNetwork::GetNextServer ( bool  bAdvance = true)
const CString& CIRCNetwork::GetNick ( const bool  bAllowDefault = true) const
const std::vector<CQuery*>& CIRCNetwork::GetQueries ( ) const
CString CIRCNetwork::GetQuitMsg ( ) const
CString CIRCNetwork::GetRealName ( ) const
const std::vector<CServer*>& CIRCNetwork::GetServers ( ) const
bool CIRCNetwork::GetTrustAllCerts ( ) const
inline

References m_bTrustAllCerts.

const SCString& CIRCNetwork::GetTrustedFingerprints ( ) const
inline
bool CIRCNetwork::GetTrustPKI ( ) const
inline

References m_bTrustPKI.

CUser* CIRCNetwork::GetUser ( ) const
bool CIRCNetwork::HasServers ( ) const
inline

References m_vServers.

void CIRCNetwork::IRCConnected ( )
void CIRCNetwork::IRCDisconnected ( )
bool CIRCNetwork::IsChan ( const CString sChan) const
bool CIRCNetwork::IsIRCAway ( ) const
inline

References m_bIRCAway.

bool CIRCNetwork::IsIRCConnected ( ) const

This method will return whether the user is connected and authenticated to an IRC server.

bool CIRCNetwork::IsLastServer ( ) const
bool CIRCNetwork::IsNetworkAttached ( ) const
inline

References m_vClients.

bool CIRCNetwork::IsUserAttached ( ) const
inline

References m_vClients.

bool CIRCNetwork::IsUserOnline ( ) const
static bool CIRCNetwork::IsValidNetwork ( const CString sNetwork)
static
void CIRCNetwork::JoinChans ( )
void CIRCNetwork::JoinChans ( std::set< CChan * > &  sChans)
CIRCNetwork& CIRCNetwork::operator= ( const CIRCNetwork )
delete
bool CIRCNetwork::ParseConfig ( CConfig pConfig,
CString sError,
bool  bUpgrade = false 
)
bool CIRCNetwork::PutIRC ( const CString sLine)
bool CIRCNetwork::PutIRC ( const CMessage Message)
bool CIRCNetwork::PutModule ( const CString sModule,
const CString sLine,
CClient pClient = nullptr,
CClient pSkipClient = nullptr 
)
bool CIRCNetwork::PutStatus ( const CString sLine,
CClient pClient = nullptr,
CClient pSkipClient = nullptr 
)
bool CIRCNetwork::PutUser ( const CString sLine,
CClient pClient = nullptr,
CClient pSkipClient = nullptr 
)
bool CIRCNetwork::PutUser ( const CMessage Message,
CClient pClient = nullptr,
CClient pSkipClient = nullptr 
)
void CIRCNetwork::SetAltNick ( const CString s)
void CIRCNetwork::SetBindHost ( const CString s)
void CIRCNetwork::SetChanPrefixes ( const CString s)
inline

References m_sChanPrefixes.

void CIRCNetwork::SetEncoding ( const CString s)
void CIRCNetwork::SetFloodBurst ( unsigned short int  uFloodBurst)
inline

References m_uFloodBurst.

void CIRCNetwork::SetFloodRate ( double  fFloodRate)
inline

References m_fFloodRate.

void CIRCNetwork::SetIdent ( const CString s)
void CIRCNetwork::SetIRCAway ( bool  b)
inline

References m_bIRCAway.

void CIRCNetwork::SetIRCConnectEnabled ( bool  b)
void CIRCNetwork::SetIRCNick ( const CNick n)
void CIRCNetwork::SetIRCServer ( const CString s)
void CIRCNetwork::SetIRCSocket ( CIRCSock pIRCSock)
void CIRCNetwork::SetJoinDelay ( unsigned short int  uJoinDelay)
inline

References m_uJoinDelay.

bool CIRCNetwork::SetName ( const CString sName)
bool CIRCNetwork::SetNextServer ( const CServer pServer)
void CIRCNetwork::SetNick ( const CString s)
void CIRCNetwork::SetQuitMsg ( const CString s)
void CIRCNetwork::SetRealName ( const CString s)
void CIRCNetwork::SetTrustAllCerts ( const bool  bTrustAll = false)
inline

References m_bTrustAllCerts.

void CIRCNetwork::SetTrustPKI ( const bool  bTrustPKI = true)
inline

References m_bTrustPKI.

void CIRCNetwork::SetUser ( CUser pUser)
CConfig CIRCNetwork::ToConfig ( ) const
void CIRCNetwork::UpdateExactRawBuffer ( const CMessage Format,
const CString sText = "" 
)
inline
void CIRCNetwork::UpdateExactRawBuffer ( const CString sFormat,
const CString sText = "" 
)
inline
void CIRCNetwork::UpdateMotdBuffer ( const CString sCommand,
const CMessage Format,
const CString sText = "" 
)
inline
void CIRCNetwork::UpdateMotdBuffer ( const CString sMatch,
const CString sFormat,
const CString sText = "" 
)
inline
void CIRCNetwork::UpdateNoticeBuffer ( const CString sCommand,
const CMessage Format,
const CString sText = "" 
)
inline
void CIRCNetwork::UpdateNoticeBuffer ( const CString sMatch,
const CString sFormat,
const CString sText = "" 
)
inline
void CIRCNetwork::UpdateRawBuffer ( const CString sCommand,
const CMessage Format,
const CString sText = "" 
)
inline
void CIRCNetwork::UpdateRawBuffer ( const CString sMatch,
const CString sFormat,
const CString sText = "" 
)
inline

Member Data Documentation

bool CIRCNetwork::m_bIRCAway
protected

Referenced by IsIRCAway(), and SetIRCAway().

bool CIRCNetwork::m_bIRCConnectEnabled
protected

Referenced by GetIRCConnectEnabled().

bool CIRCNetwork::m_bTrustAllCerts
protected
bool CIRCNetwork::m_bTrustPKI
protected

Referenced by GetTrustPKI(), and SetTrustPKI().

double CIRCNetwork::m_fFloodRate
protected

Set to -1 to disable protection.

Referenced by GetFloodRate(), and SetFloodRate().

CNick CIRCNetwork::m_IRCNick
protected
CBuffer CIRCNetwork::m_MotdBuffer
protected
CBuffer CIRCNetwork::m_NoticeBuffer
protected
CIRCSock* CIRCNetwork::m_pIRCSock
protected

Referenced by GetIRCSock().

CIRCNetworkJoinTimer* CIRCNetwork::m_pJoinTimer
protected
CModules* CIRCNetwork::m_pModules
protected

Referenced by GetModules().

CIRCNetworkPingTimer* CIRCNetwork::m_pPingTimer
protected
CUser* CIRCNetwork::m_pUser
protected
CBuffer CIRCNetwork::m_RawBuffer
protected
CString CIRCNetwork::m_sAltNick
protected
CString CIRCNetwork::m_sBindHost
protected
CString CIRCNetwork::m_sChanPrefixes
protected

Referenced by GetChanPrefixes(), and SetChanPrefixes().

CString CIRCNetwork::m_sEncoding
protected
CString CIRCNetwork::m_sIdent
protected
CString CIRCNetwork::m_sIRCServer
protected
CString CIRCNetwork::m_sName
protected
CString CIRCNetwork::m_sNick
protected
CString CIRCNetwork::m_sQuitMsg
protected
CString CIRCNetwork::m_sRealName
protected
SCString CIRCNetwork::m_ssTrustedFingerprints
protected
unsigned long long CIRCNetwork::m_uBytesRead
protected

Referenced by AddBytesRead(), and BytesRead().

unsigned long long CIRCNetwork::m_uBytesWritten
protected

Referenced by AddBytesWritten(), and BytesWritten().

unsigned short int CIRCNetwork::m_uFloodBurst
protected

Referenced by GetFloodBurst(), and SetFloodBurst().

unsigned short int CIRCNetwork::m_uJoinDelay
protected

Referenced by GetJoinDelay(), and SetJoinDelay().

size_t CIRCNetwork::m_uServerIdx
protected

Index in m_vServers of our current server + 1.

std::vector<CChan*> CIRCNetwork::m_vChans
protected
std::vector<CClient*> CIRCNetwork::m_vClients
protected
std::vector<CQuery*> CIRCNetwork::m_vQueries
protected
std::vector<CServer*> CIRCNetwork::m_vServers
protected

Referenced by HasServers().


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