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
24 : d(new ResourceWrapperPrivate)
25{
26 d->resource = ResourcePtr(new Resource());
27}
28
30{
31 *this = other;
32}
33
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
45
47{
48 d = other.d;
49 return *this;
50}
51
53{
54 return *(d->resource) == *(other.d->resource);
55}
56
58{
59 return d->resource->isNull();
60}
61
63{
64 return d->resource;
65}
66
67} // namespace RDF
68} // namespace Syndication
A wrapper for RDF resources.
ResourceWrapper & operator=(const ResourceWrapper &other)
Assignment oeprator Due to the shared d pointer, this is a cheap operation.
ResourceWrapper()
creates a wrapper wrapping a null resource, isNull() will be true.
bool isNull() const
returns whether the wrapped resource is a null resource
bool operator==(const ResourceWrapper &other) const
compares two resource wrapper instances.
ResourcePtr resource() const
returns the wrapped resource.
Resources are the entities in the RDF graph.
Definition resource.h:37
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.