summaryrefslogtreecommitdiff
path: root/src/modules/extra/m_sqlv2.h
diff options
context:
space:
mode:
authorpeavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7>2008-05-09 04:08:27 +0000
committerpeavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7>2008-05-09 04:08:27 +0000
commita8bdf9887f5be40fae774d8bea93e99b5a0932c5 (patch)
tree02d7c8b2c837ffd776761a5611aa0a5ef324ea7e /src/modules/extra/m_sqlv2.h
parent6087d621f732289966d52e253477e3faa8e3f1bb (diff)
Add defaults for SQLHost since comparing depends on them being initialised. Add also overload for operator!= for SQLhost.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9675 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/extra/m_sqlv2.h')
-rw-r--r--src/modules/extra/m_sqlv2.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/modules/extra/m_sqlv2.h b/src/modules/extra/m_sqlv2.h
index 2e0ab2a19..cd3ea0eca 100644
--- a/src/modules/extra/m_sqlv2.h
+++ b/src/modules/extra/m_sqlv2.h
@@ -440,11 +440,12 @@ class SQLhost
bool ssl; /* If we should require SSL */
SQLhost()
+ : id(""), host(""), ip(""), port(0), name(""), user(""), pass(""), ssl(0)
{
}
SQLhost(const std::string& i, const std::string& h, unsigned int p, const std::string& n, const std::string& u, const std::string& pa, bool s)
- : id(i), host(h), port(p), name(n), user(u), pass(pa), ssl(s)
+ : id(i), host(h), ip(""), port(p), name(n), user(u), pass(pa), ssl(s)
{
}
@@ -460,6 +461,12 @@ bool operator== (const SQLhost& l, const SQLhost& r)
{
return (l.id == r.id && l.host == r.host && l.port == r.port && l.name == r.name && l.user == l.user && l.pass == r.pass && l.ssl == r.ssl);
}
+/** Overload operator!= for two SQLhost objects for easy comparison.
+ */
+bool operator!= (const SQLhost& l, const SQLhost& r)
+{
+ return (l.id != r.id || l.host != r.host || l.port != r.port || l.name != r.name || l.user != l.user || l.pass != r.pass || l.ssl != r.ssl);
+}
/** QueryQueue, a queue of queries waiting to be executed.