diff options
| author | Jeremy Lainé <jeremy.laine@m4x.org> | 2010-08-29 15:28:28 +0000 |
|---|---|---|
| committer | Jeremy Lainé <jeremy.laine@m4x.org> | 2010-08-29 15:28:28 +0000 |
| commit | c4ccfbf5795d7cdc37fb32ebdd145ae0e68b5b77 (patch) | |
| tree | d8cec84d7b4ef0eb50ea7e5679a736fbdd0f3cb9 /src/QXmppServiceInfo.h | |
| parent | f88c369a352750426ef3eeb67130777e8af80176 (diff) | |
| download | qxmpp-c4ccfbf5795d7cdc37fb32ebdd145ae0e68b5b77.tar.gz | |
improve DNS SRV lookup API
Diffstat (limited to 'src/QXmppServiceInfo.h')
| -rw-r--r-- | src/QXmppServiceInfo.h | 24 |
1 files changed, 19 insertions, 5 deletions
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 <QList> #include <QString> -/// \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<QXmppServiceInfo> &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<QXmppServiceRecord> records() const; + + static QXmppServiceInfo fromName(const QString &dname); + +private: + QString m_errorString; + QList<QXmppServiceRecord> m_records; +}; + #endif |
