| 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 | |
| 13 | namespace Syndication |
| 14 | { |
| 15 | namespace Atom |
| 16 | { |
| 17 | Generator::Generator() |
| 18 | : ElementWrapper() |
| 19 | { |
| 20 | } |
| 21 | |
| 22 | Generator::Generator(const QDomElement &element) |
| 23 | : ElementWrapper(element) |
| 24 | { |
| 25 | } |
| 26 | |
| 27 | QString Generator::uri() const |
| 28 | { |
| 29 | return completeURI(uri: attribute(QStringLiteral("uri" ))); |
| 30 | } |
| 31 | |
| 32 | QString Generator::name() const |
| 33 | { |
| 34 | return text(); |
| 35 | } |
| 36 | |
| 37 | QString Generator::version() const |
| 38 | { |
| 39 | return attribute(QStringLiteral("version" )); |
| 40 | } |
| 41 | |
| 42 | QString Generator::debugInfo() const |
| 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 |
| 60 | |