Added IsValidHostName()

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@214 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
prozacx
2005-04-30 19:11:07 +00:00
parent 8ccb908194
commit 7578ec11e7
2 changed files with 17 additions and 0 deletions

View File

@@ -10,6 +10,22 @@ CServer::CServer(const string& sName, unsigned short uPort, const string& sPass,
CServer::~CServer() {}
bool CServer::IsValidHostName(const string& sHostName) {
const char* p = sHostName.c_str();
if (sHostName.empty()) {
return false;
}
while (*p) {
if (*p++ == ' ') {
return false;
}
}
return true;
}
const string& CServer::GetName() const { return m_sName; }
unsigned short CServer::GetPort() const { return m_uPort; }
const string& CServer::GetPass() const { return m_sPass; }

View File

@@ -12,6 +12,7 @@ public:
unsigned short GetPort() const;
const string& GetPass() const;
bool IsSSL() const;
static bool IsValidHostName(const string& sHostName);
private:
protected:
string m_sName;