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 "source.h"
9#include "tools.h"
10
11#include <QString>
12
13namespace Syndication
14{
15namespace RSS2
16{
17Source::Source()
18 : ElementWrapper()
19{
20}
21
22Source::Source(const QDomElement &element)
23 : ElementWrapper(element)
24{
25}
26
27QString Source::source() const
28{
29 return text();
30}
31
32QString Source::url() const
33{
34 return attribute(QStringLiteral("url"));
35}
36
37QString Source::debugInfo() const
38{
39 QString info = QLatin1String("### Source: ###################\n");
40 if (!source().isNull()) {
41 info += QLatin1String("source: #") + source() + QLatin1String("#\n");
42 }
43 if (!url().isNull()) {
44 info += QLatin1String("url: #") + url() + QLatin1String("#\n");
45 }
46 info += QLatin1String("### Source end ################\n");
47 return info;
48}
49
50} // namespace RSS2
51} // namespace Syndication
52

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