File indexing completed on 2024-07-07 03:55:21

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 "person.h"
0009 #include "constants.h"
0010 
0011 #include <QString>
0012 
0013 namespace Syndication
0014 {
0015 namespace Atom
0016 {
0017 Person::Person()
0018     : ElementWrapper()
0019 {
0020 }
0021 
0022 Person::Person(const QDomElement &element)
0023     : ElementWrapper(element)
0024 {
0025 }
0026 
0027 QString Person::name() const
0028 {
0029     return extractElementTextNS(atom1Namespace(), QStringLiteral("name"));
0030 }
0031 
0032 QString Person::uri() const
0033 {
0034     return completeURI(extractElementTextNS(atom1Namespace(), QStringLiteral("uri")));
0035 }
0036 
0037 QString Person::email() const
0038 {
0039     return extractElementTextNS(atom1Namespace(), QStringLiteral("email"));
0040 }
0041 
0042 QString Person::debugInfo() const
0043 {
0044     QString info = QLatin1String("### Person: ###################\n");
0045     info += QLatin1String("name: #") + name() + QLatin1String("#\n");
0046     info += QLatin1String("email: #") + email() + QLatin1String("#\n");
0047     info += QLatin1String("uri: #") + uri() + QLatin1String("#\n");
0048     info += QLatin1String("### Person end ################\n");
0049 
0050     return info;
0051 }
0052 
0053 } // namespace Atom
0054 } // namespace Syndication