Add a new function CModule::PutModule(const CTable&)

This function displays a CTable via PutModule(), something that is often
needed. The function returns the number of lines displayed.

The idea for this function is from the user-contributed admin module
by Sebastian Ramacher. Thanks.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1168 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
psychon
2008-08-24 12:49:40 +00:00
parent 09a122ef92
commit b70a115a28
2 changed files with 11 additions and 0 deletions

View File

@@ -503,6 +503,16 @@ bool CModule::PutUser(const CString& sLine) {
bool CModule::PutStatus(const CString& sLine) {
return (m_pUser) ? m_pUser->PutStatus(sLine, m_pClient) : false;
}
unsigned int CModule::PutModule(const CTable& table, const CString& sIdent, const CString& sHost) {
if (!m_pUser)
return 0;
unsigned int idx = 0;
CString sLine;
while (table.GetLine(idx++, sLine))
PutModule(sLine, sIdent, sHost);
return idx - 1;
}
bool CModule::PutModule(const CString& sLine, const CString& sIdent, const CString& sHost) {
if (!m_pUser)
return false;