Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add CIRCNetwork::FindChans()

  • Loading branch information...
commit ed25ca21e67961271473dcdc1683b09de47529e7 1 parent 0a0be77
@jpnurmi jpnurmi authored
Showing with 11 additions and 0 deletions.
  1. +1 −0  include/znc/IRCNetwork.h
  2. +10 −0 src/IRCNetwork.cpp
View
1  include/znc/IRCNetwork.h
@@ -76,6 +76,7 @@ class CIRCNetwork {
const std::vector<CChan*>& GetChans() const;
CChan* FindChan(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);
View
10 src/IRCNetwork.cpp
@@ -649,6 +649,16 @@ CChan* CIRCNetwork::FindChan(CString sName) const {
return NULL;
}
+std::vector<CChan*> CIRCNetwork::FindChans(const CString& sWild) const {
+ std::vector<CChan*> vChans;
+ vChans.reserve(m_vChans.size());
+ for (std::vector<CChan*>::const_iterator it = m_vChans.begin(); it != m_vChans.end(); ++it) {
+ if ((*it)->GetName().WildCmp(sWild))
+ vChans.push_back(*it);
+ }
+ return vChans;
+}
+
bool CIRCNetwork::AddChan(CChan* pChan) {
if (!pChan) {
return false;
Please sign in to comment.
Something went wrong with that request. Please try again.