Syndication

atom/category.cpp
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{
22
27
29{
30 return attribute(QStringLiteral("term"));
31}
32
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
42{
43 return attribute(QStringLiteral("label"));
44}
45
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
Category()
creates a null category object.
QString term() const
a term describing the category.
QString scheme() const
naming scheme the category term is part of.
QString label() const
Label of the category (optional).
QString debugInfo() const
description of this category object for debugging purposes
const QDomElement & element() const
returns the wrapped resource.
ElementWrapper()
creates a element wrapper wrapping a null element.
QString attribute(const QString &name, const QString &defValue=QString()) const
Returns the attribute called name.
Atom parser and model classes, representing Atom 1.0 documents (Atom 0.3 documents are converted by t...
Definition atom.h:30
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:48:38 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.