Syndication

generator.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 "generator.h"
9#include "constants.h"
10
11#include <QString>
12
13namespace Syndication
14{
15namespace Atom
16{
21
23 : ElementWrapper(element)
24{
25}
26
28{
29 return completeURI(attribute(QStringLiteral("uri")));
30}
31
33{
34 return text();
35}
36
38{
39 return attribute(QStringLiteral("version"));
40}
41
43{
44 QString info = QLatin1String("### Generator: ###################\n");
45 if (!name().isEmpty()) {
46 info += QLatin1String("name: #") + name() + QLatin1String("#\n");
47 }
48 if (!uri().isEmpty()) {
49 info += QLatin1String("uri: #") + uri() + QLatin1String("#\n");
50 }
51 if (!version().isEmpty()) {
52 info += QLatin1String("version: #") + version() + QLatin1String("#\n");
53 }
54 info += QLatin1String("### Generator end ################\n");
55 return info;
56}
57
58} // namespace Atom
59} // namespace Syndication
Generator()
default constructor, creates a null generator
Definition generator.cpp:17
QString uri() const
A URI for the generator (e.g.
Definition generator.cpp:27
QString version() const
version of the agent (optional)
Definition generator.cpp:37
QString debugInfo() const
a description of this generator for debugging purposes.
Definition generator.cpp:42
QString name() const
human-readable name of the generator.
Definition generator.cpp:32
A wrapper for XML elements.
QString text() const
Returns the wrapped element's text or an empty string.
QString completeURI(const QString &uri) const
completes relative URIs with a prefix specified via xml:base.
QString attribute(const QString &name, const QString &defValue=QString()) const
Returns the attribute called name.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Jul 26 2024 11:52:19 by doxygen 1.11.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.