Syndication

cloud.cpp
1 /*
2  This file is part of the syndication library
3  SPDX-FileCopyrightText: 2005 Frank Osterfeld <[email protected]>
4 
5  SPDX-License-Identifier: LGPL-2.0-or-later
6 */
7 
8 #include "cloud.h"
9 
10 #include <QString>
11 
12 namespace Syndication
13 {
14 namespace RSS2
15 {
17  : ElementWrapper()
18 {
19 }
20 
21 Cloud::Cloud(const QDomElement &element)
22  : ElementWrapper(element)
23 {
24 }
25 
27 {
28  return attribute(QStringLiteral("domain"));
29 }
30 
31 int Cloud::port() const
32 {
33  if (hasAttribute(QStringLiteral("port"))) {
34  bool ok;
35  int c = attribute(QStringLiteral("port")).toInt(&ok);
36  return ok ? c : -1;
37  }
38 
39  return -1;
40 }
41 
43 {
44  return attribute(QStringLiteral("path"));
45 }
46 
48 {
49  return attribute(QStringLiteral("registerProcedure"));
50 }
51 
53 {
54  return attribute(QStringLiteral("protocol"));
55 }
56 
58 {
59  QString info = QLatin1String("### Cloud: ###################\n");
60  if (!domain().isNull()) {
61  info += QLatin1String("domain: #") + domain() + QLatin1String("#\n");
62  }
63  if (port() != -1) {
64  info += QLatin1String("port: #") + QString::number(port()) + QLatin1String("#\n");
65  }
66  if (!path().isNull()) {
67  info += QLatin1String("path: #") + path() + QLatin1String("#\n");
68  }
69  if (!registerProcedure().isNull()) {
70  info += QLatin1String("registerProcedure: #") + registerProcedure() + QLatin1String("#\n");
71  }
72  if (!protocol().isNull()) {
73  info += QLatin1String("protocol: #") + protocol() + QLatin1String("#\n");
74  }
75  info += QLatin1String("### Cloud end ################\n");
76  return info;
77 }
78 
79 } // namespace RSS2
80 } // namespace Syndication
QString number(int n, int base)
QString debugInfo() const
Returns a description of the object for debugging purposes.
Definition: cloud.cpp:57
QString path() const
the remote path to connect to
Definition: cloud.cpp:42
QString registerProcedure() const
register procedure, e.g.
Definition: cloud.cpp:47
QString protocol() const
protocol used for publish-subscribe, e.g.
Definition: cloud.cpp:52
int port() const
the remote port to connect to
Definition: cloud.cpp:31
QString domain() const
the remote domain
Definition: cloud.cpp:26
Cloud()
Default constructor, creates a null object, for which isNull() is true.
Definition: cloud.cpp:16
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Tue Dec 5 2023 03:58:07 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.