From c4ccfbf5795d7cdc37fb32ebdd145ae0e68b5b77 Mon Sep 17 00:00:00 2001 From: Jeremy Lainé Date: Sun, 29 Aug 2010 15:28:28 +0000 Subject: improve DNS SRV lookup API --- src/QXmppServiceInfo.h | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) (limited to 'src/QXmppServiceInfo.h') diff --git a/src/QXmppServiceInfo.h b/src/QXmppServiceInfo.h index 6dd44476..51e71282 100644 --- a/src/QXmppServiceInfo.h +++ b/src/QXmppServiceInfo.h @@ -27,13 +27,13 @@ #include #include -/// \brief The QXmppServiceInfo class is used to perform DNS SRV queries. +/// \brief The QXmppServiceRecord class represents a DNS SRV record. /// -class QXmppServiceInfo +class QXmppServiceRecord { public: - QXmppServiceInfo(); + QXmppServiceRecord(); QString hostName() const; void setHostName(const QString &hostName); @@ -41,11 +41,25 @@ public: quint16 port() const; void setPort(quint16 port); - static bool lookupService(const QString &dname, QList &results); - private: QString host_name; quint16 host_port; }; +/// \brief The QXmppServiceInfo class provides static methods for DNS SRV lookups. +/// + +class QXmppServiceInfo +{ +public: + QString errorString() const; + QList records() const; + + static QXmppServiceInfo fromName(const QString &dname); + +private: + QString m_errorString; + QList m_records; +}; + #endif -- cgit v1.2.3