File indexing completed on 2023-10-03 03:26:51
0001 /* 0002 This file is part of the syndication library 0003 SPDX-FileCopyrightText: 2005 Frank Osterfeld <osterfeld@kde.org> 0004 0005 SPDX-License-Identifier: LGPL-2.0-or-later 0006 */ 0007 0008 #include "category.h" 0009 #include "tools.h" 0010 0011 #include <QString> 0012 0013 namespace Syndication 0014 { 0015 namespace RSS2 0016 { 0017 Category::Category() 0018 : ElementWrapper() 0019 { 0020 } 0021 0022 Category::Category(const QDomElement &element) 0023 : ElementWrapper(element) 0024 { 0025 } 0026 QString Category::category() const 0027 { 0028 return text().simplified(); 0029 } 0030 0031 QString Category::domain() const 0032 { 0033 return attribute(QStringLiteral("domain")); 0034 } 0035 0036 QString Category::debugInfo() const 0037 { 0038 QString info = QLatin1String("### Category: ###################\n"); 0039 if (!category().isNull()) { 0040 info += QLatin1String("category: #") + category() + QLatin1String("#\n"); 0041 } 0042 if (!domain().isNull()) { 0043 info += QLatin1String("domain: #") + domain() + QLatin1String("#\n"); 0044 } 0045 info += QLatin1String("### Category end ################\n"); 0046 return info; 0047 } 0048 0049 } // namespace RSS2 0050 } // namespace Syndication