Syndication

resourcewrapper.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 "resourcewrapper.h"
9#include "model.h"
10#include "resource.h"
11
12namespace Syndication
13{
14namespace RDF
15{
16class SYNDICATION_NO_EXPORT ResourceWrapper::ResourceWrapperPrivate
17{
18public:
19 ResourcePtr resource;
20 Model model;
21};
22
23ResourceWrapper::ResourceWrapper()
24 : d(new ResourceWrapperPrivate)
25{
26 d->resource = ResourcePtr(new Resource());
27}
28
29ResourceWrapper::ResourceWrapper(const ResourceWrapper &other)
30{
31 *this = other;
32}
33
34ResourceWrapper::ResourceWrapper(ResourcePtr resource)
35 : d(new ResourceWrapperPrivate)
36{
37 // if a null pointer is passed, we create a null resource
38 d->resource = !resource ? ResourcePtr(new Resource()) : resource;
39 d->model = d->resource->model();
40}
41
42ResourceWrapper::~ResourceWrapper()
43{
44}
45
46ResourceWrapper &ResourceWrapper::operator=(const ResourceWrapper &other)
47{
48 d = other.d;
49 return *this;
50}
51
52bool ResourceWrapper::operator==(const ResourceWrapper &other) const
53{
54 return *(d->resource) == *(other.d->resource);
55}
56
57bool ResourceWrapper::isNull() const
58{
59 return d->resource->isNull();
60}
61
62ResourcePtr ResourceWrapper::resource() const
63{
64 return d->resource;
65}
66
67} // namespace RDF
68} // 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.