diff options
Diffstat (limited to 'src/net/serverinfo.h')
-rw-r--r-- | src/net/serverinfo.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/net/serverinfo.h b/src/net/serverinfo.h index ae06984b..a1e22ce7 100644 --- a/src/net/serverinfo.h +++ b/src/net/serverinfo.h @@ -55,6 +55,11 @@ public: port = info.port; } + bool isValid() const + { + return !(hostname.empty() || port == 0 || type == UNKNOWN); + } + void clear() { type = UNKNOWN; @@ -63,13 +68,13 @@ public: port = 0; } - bool operator==(const ServerInfo &other) + bool operator==(const ServerInfo &other) const { return (type == other.type && hostname == other.hostname && port == other.port); } - bool operator!=(const ServerInfo &other) + bool operator!=(const ServerInfo &other) const { return (type != other.type || hostname != other.hostname || port != other.port); |