Syndication

resourcewrapper.cpp
1 /*
2  This file is part of the syndication library
3  SPDX-FileCopyrightText: 2006 Frank Osterfeld <[email protected]>
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 
12 namespace Syndication
13 {
14 namespace RDF
15 {
16 class ResourceWrapper::ResourceWrapperPrivate
17 {
18 public:
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 
43 {
44 }
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
bool isNull() const const
bool isNull() const
returns whether the wrapped resource is a null resource
ResourceWrapper()
creates a wrapper wrapping a null resource, isNull() will be true.
Model
Definition: resource.h:38
Resources are the entities in the RDF graph.
Definition: resource.h:36
A wrapper for RDF resources.
ResourceWrapper & operator=(const ResourceWrapper &other)
Assignment oeprator Due to the shared d pointer, this is a cheap operation.
bool operator==(const ResourceWrapper &other) const
compares two resource wrapper instances.
ResourcePtr resource() const
returns the wrapped resource.
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Mon Jun 27 2022 04:08:15 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.