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