Syndication

atom/person.cpp
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 "person.h"
9#include "constants.h"
10
11#include <QString>
12
13namespace Syndication
14{
15namespace Atom
16{
21
23 : ElementWrapper(element)
24{
25}
26
28{
29 return extractElementTextNS(atom1Namespace(), QStringLiteral("name"));
30}
31
33{
34 return completeURI(extractElementTextNS(atom1Namespace(), QStringLiteral("uri")));
35}
36
38{
39 return extractElementTextNS(atom1Namespace(), QStringLiteral("email"));
40}
41
43{
44 QString info = QLatin1String("### Person: ###################\n");
45 info += QLatin1String("name: #") + name() + QLatin1String("#\n");
46 info += QLatin1String("email: #") + email() + QLatin1String("#\n");
47 info += QLatin1String("uri: #") + uri() + QLatin1String("#\n");
48 info += QLatin1String("### Person end ################\n");
49
50 return info;
51}
52
53} // namespace Atom
54} // namespace Syndication
QString name() const
a human-readable name for the person.
QString debugInfo() const
description for debugging purposes
QString email() const
returns an e-mail address associated with the person.
Person()
creates a null person object
QString uri() const
A URI associated with the person (optional).
A wrapper for XML elements.
QString completeURI(const QString &uri) const
completes relative URIs with a prefix specified via xml:base.
QString extractElementTextNS(const QString &namespaceURI, const QString &localName) const
extracts the text from a child element, respecting namespaces.
QString atom1Namespace()
namespace used by Atom 1.0 elements
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:03:18 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.