Syndication

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

KDE's Doxygen guidelines are available online.