aboutsummaryrefslogtreecommitdiff
path: root/src/QXmppSrvInfo.h
diff options
context:
space:
mode:
authorJeremy Lainé <jeremy.laine@m4x.org>2010-09-03 09:37:49 +0000
committerJeremy Lainé <jeremy.laine@m4x.org>2010-09-03 09:37:49 +0000
commit6aa29f3cf73b93797076b5bec4a220c08dc765fb (patch)
tree1f1f34b5a70546596a29361d88fd5d3ba6faf353 /src/QXmppSrvInfo.h
parent00795301d517e9084f8f9f75b1c271d2da8cc865 (diff)
downloadqxmpp-6aa29f3cf73b93797076b5bec4a220c08dc765fb.tar.gz
rename QXmppSrvLookup to QXmppSrvInfo, and restore previous API
Diffstat (limited to 'src/QXmppSrvInfo.h')
-rw-r--r--src/QXmppSrvInfo.h65
1 files changed, 65 insertions, 0 deletions
diff --git a/src/QXmppSrvInfo.h b/src/QXmppSrvInfo.h
new file mode 100644
index 00000000..3c36867a
--- /dev/null
+++ b/src/QXmppSrvInfo.h
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2008-2010 The QXmpp developers
+ *
+ * Author:
+ * Jeremy Lainé
+ *
+ * Source:
+ * http://code.google.com/p/qxmpp
+ *
+ * This file is a part of QXmpp library.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ */
+
+#ifndef QXMPPSRVINFO_H
+#define QXMPPSRVINFO_H
+
+#include <QList>
+#include <QString>
+
+/// \brief The QXmppSrvRecord class represents a DNS SRV record.
+///
+
+class QXmppSrvRecord
+{
+public:
+ QXmppSrvRecord();
+
+ QString hostName() const;
+ void setHostName(const QString &hostName);
+
+ quint16 port() const;
+ void setPort(quint16 port);
+
+private:
+ QString host_name;
+ quint16 host_port;
+};
+
+/// \brief The QXmppSrvInfo class provides static methods for DNS SRV lookups.
+///
+
+class QXmppSrvInfo
+{
+public:
+ QString errorString() const;
+ QList<QXmppSrvRecord> records() const;
+
+ static QXmppSrvInfo fromName(const QString &dname);
+
+private:
+ QString m_errorString;
+ QList<QXmppSrvRecord> m_records;
+};
+
+#endif