1/*
2 This file is part of the syndication library
3 SPDX-FileCopyrightText: 2005 Frank Osterfeld <osterfeld@kde.org>
4
5 SPDX-License-Identifier: LGPL-2.0-or-later
6*/
7
8#include "cloud.h"
9
10#include <QString>
11
12namespace Syndication
13{
14namespace RSS2
15{
16Cloud::Cloud()
17 : ElementWrapper()
18{
19}
20
21Cloud::Cloud(const QDomElement &element)
22 : ElementWrapper(element)
23{
24}
25
26QString Cloud::domain() const
27{
28 return attribute(QStringLiteral("domain"));
29}
30
31int Cloud::port() const
32{
33 if (hasAttribute(QStringLiteral("port"))) {
34 bool ok;
35 int c = attribute(QStringLiteral("port")).toInt(ok: &ok);
36 return ok ? c : -1;
37 }
38
39 return -1;
40}
41
42QString Cloud::path() const
43{
44 return attribute(QStringLiteral("path"));
45}
46
47QString Cloud::registerProcedure() const
48{
49 return attribute(QStringLiteral("registerProcedure"));
50}
51
52QString Cloud::protocol() const
53{
54 return attribute(QStringLiteral("protocol"));
55}
56
57QString Cloud::debugInfo() const
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
81

source code of syndication/src/rss2/cloud.cpp