1/*
2 This file is part of the syndication library
3 SPDX-FileCopyrightText: 2006 Frank Osterfeld <osterfeld@kde.org>
4
5 SPDX-License-Identifier: LGPL-2.0-or-later
6*/
7
8#include "category.h"
9#include "constants.h"
10
11#include <QDomElement>
12#include <QString>
13
14namespace Syndication
15{
16namespace Atom
17{
18Category::Category()
19 : ElementWrapper()
20{
21}
22
23Category::Category(const QDomElement &element)
24 : ElementWrapper(element)
25{
26}
27
28QString Category::term() const
29{
30 return attribute(QStringLiteral("term"));
31}
32
33QString Category::scheme() const
34{
35 // NOTE: The scheme IRI is not completed by purpose.
36 // According to Atom spec, it must be an absolute IRI.
37 // If this is a problem with real-world feeds, it might be changed.
38 return attribute(QStringLiteral("scheme"));
39}
40
41QString Category::label() const
42{
43 return attribute(QStringLiteral("label"));
44}
45
46QString Category::debugInfo() const
47{
48 QString info = QLatin1String("### Category: ###################\n");
49 info += QLatin1String("term: #") + term() + QLatin1String("#\n");
50 if (!scheme().isEmpty()) {
51 info += QLatin1String("scheme: #") + scheme() + QLatin1String("#\n");
52 }
53 if (!label().isEmpty()) {
54 info += QLatin1String("label: #") + label() + QLatin1String("#\n");
55 }
56 info += QLatin1String("### Category end ################\n");
57
58 return info;
59}
60
61} // namespace Atom
62} // namespace Syndication
63

source code of syndication/src/atom/category.cpp