Added some helper functions

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@455 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
prozacx
2005-08-02 17:44:46 +00:00
parent dc33b862a7
commit 7cb1d2f958
2 changed files with 13 additions and 2 deletions
+9 -1
View File
@@ -19,7 +19,7 @@ CZNC::CZNC() {
#endif
m_uListenPort = 0;
m_bISpoofLocked = false;
m_sISpoofFormat = "global { reply \"%\" }";
SetISpoofFormat(""); // Set ISpoofFormat to default
}
CZNC::~CZNC() {
@@ -1015,7 +1015,15 @@ bool CZNC::ParseConfig(const CString& sConfig) {
return true;
}
void CZNC::ClearVHosts() {
m_vsVHosts.clear();
}
bool CZNC::AddVHost(const CString& sHost) {
if (sHost.empty()) {
return false;
}
for (unsigned int a = 0; a < m_vsVHosts.size(); a++) {
if (m_vsVHosts[a].CaseCmp(sHost) == 0) {
return false;
+4 -1
View File
@@ -35,12 +35,14 @@ public:
bool WriteConfig();
static CString GetTag(bool bIncludeVersion = true);
CString FindModPath(const CString& sModule) const;
void ClearVHosts();
bool AddVHost(const CString& sHost);
bool RemVHost(const CString& sHost);
// Setters
void SetStatusPrefix(const CString& s) { m_sStatusPrefix = (s.empty()) ? "*" : s; }
void SetISpoofFile(const CString& s) { m_sISpoofFile = s; }
void SetISpoofFormat(const CString& s) { m_sISpoofFormat = s; }
void SetISpoofFormat(const CString& s) { m_sISpoofFormat = (s.empty()) ? "global { reply \"%\" }" : s; }
// !Setters
// Getters
@@ -49,6 +51,7 @@ public:
CGlobalModules& GetModules() { return *m_pModules; }
#endif
unsigned short GetListenPort() const { return m_uListenPort; }
const CString& GetStatusPrefix() const { return m_sStatusPrefix; }
const CString& GetCurPath() const { if (!CFile::Exists(m_sCurPath)) { CUtils::MakeDir(m_sCurPath); } return m_sCurPath; }
const CString& GetModPath() const { if (!CFile::Exists(m_sModPath)) { CUtils::MakeDir(m_sModPath); } return m_sModPath; }
const CString& GetHomePath() const { if (!CFile::Exists(m_sHomePath)) { CUtils::MakeDir(m_sHomePath); } return m_sHomePath; }