Syndication

sequence.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 "sequence.h"
9#include "node.h"
10#include "nodevisitor.h"
11
12#include <QList>
13#include <QString>
14
15namespace Syndication
16{
17namespace RDF
18{
19class SYNDICATION_NO_EXPORT Sequence::SequencePrivate
20{
21public:
22 QList<NodePtr> items;
23};
24
25Sequence::Sequence()
26 : Resource()
27 , d()
28{
29}
30
31Sequence::Sequence(const QString &uri)
32 : Resource(uri)
33 , d(new SequencePrivate)
34{
35}
36
37Sequence::Sequence(const Sequence &other)
38 : Resource(other)
39{
40 *this = other;
41}
42
43Sequence::~Sequence()
44{
45}
46void Sequence::accept(NodeVisitor *visitor, NodePtr ptr)
47{
48 SequencePtr sptr = ptr.staticCast<Sequence>();
49 if (!visitor->visitSequence(sptr)) {
50 Resource::accept(visitor, ptr);
51 }
52}
53
54Sequence *Sequence::clone() const
55{
56 return new Sequence(*this);
57}
58
59Sequence &Sequence::operator=(const Sequence &other)
60{
61 Resource::operator=(other);
62 d = other.d;
63 return *this;
64}
65
66void Sequence::append(NodePtr node)
67{
68 if (d) {
69 d->items.append(node);
70 }
71}
72
73QList<NodePtr> Sequence::items() const
74{
75 return d ? d->items : QList<NodePtr>();
76}
77
78bool Sequence::isSequence() const
79{
80 return true;
81}
82
83} // namespace RDF
84} // namespace Syndication
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:14:15 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.