File indexing completed on 2024-09-08 12:24:32
0001 /* 0002 This file is part of the syndication library 0003 SPDX-FileCopyrightText: 2006 Frank Osterfeld <osterfeld@kde.org> 0004 0005 SPDX-License-Identifier: LGPL-2.0-or-later 0006 */ 0007 0008 #include "generator.h" 0009 #include "constants.h" 0010 0011 #include <QString> 0012 0013 namespace Syndication 0014 { 0015 namespace Atom 0016 { 0017 Generator::Generator() 0018 : ElementWrapper() 0019 { 0020 } 0021 0022 Generator::Generator(const QDomElement &element) 0023 : ElementWrapper(element) 0024 { 0025 } 0026 0027 QString Generator::uri() const 0028 { 0029 return completeURI(attribute(QStringLiteral("uri"))); 0030 } 0031 0032 QString Generator::name() const 0033 { 0034 return text(); 0035 } 0036 0037 QString Generator::version() const 0038 { 0039 return attribute(QStringLiteral("version")); 0040 } 0041 0042 QString Generator::debugInfo() const 0043 { 0044 QString info = QLatin1String("### Generator: ###################\n"); 0045 if (!name().isEmpty()) { 0046 info += QLatin1String("name: #") + name() + QLatin1String("#\n"); 0047 } 0048 if (!uri().isEmpty()) { 0049 info += QLatin1String("uri: #") + uri() + QLatin1String("#\n"); 0050 } 0051 if (!version().isEmpty()) { 0052 info += QLatin1String("version: #") + version() + QLatin1String("#\n"); 0053 } 0054 info += QLatin1String("### Generator end ################\n"); 0055 return info; 0056 } 0057 0058 } // namespace Atom 0059 } // namespace Syndication