Attica

itemjob.cpp
1/*
2 This file is part of KDE.
3
4 SPDX-FileCopyrightText: 2009 Frederik Gladhorn <gladhorn@kde.org>
5 SPDX-FileCopyrightText: 2011 Laszlo Papp <djszapi@archlinux.us>
6
7 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
8*/
9
10#include "itemjob.h"
11
12using namespace Attica;
13
14template<class T>
15ItemJob<T>::ItemJob(PlatformDependent *internals, const QNetworkRequest &request)
16 : GetJob(internals, request)
17{
18}
19
20template<class T>
21void ItemJob<T>::parse(const QString &xml)
22{
23 typename T::Parser p;
24 m_item = p.parse(xml);
25 setMetadata(p.metadata());
26}
27
28template<class T>
29T ItemJob<T>::result() const
30{
31 return m_item;
32}
33
34template<class T>
35ItemDeleteJob<T>::ItemDeleteJob(PlatformDependent *internals, const QNetworkRequest &request)
36 : DeleteJob(internals, request)
37{
38}
39
40template<class T>
41void ItemDeleteJob<T>::parse(const QString &xml)
42{
43 typename T::Parser p;
44 m_item = p.parse(xml);
45 setMetadata(p.metadata());
46}
47
48template<class T>
50{
51 return m_item;
52}
53
54template<class T>
55ItemPostJob<T>::ItemPostJob(PlatformDependent *internals, const QNetworkRequest &request, QIODevice *data)
56 : PostJob(internals, request, data)
57{
58}
59
60template<class T>
61ItemPostJob<T>::ItemPostJob(PlatformDependent *internals, const QNetworkRequest &request, const StringMap &parameters)
62 : PostJob(internals, request, parameters)
63{
64}
65
66template<class T>
67void ItemPostJob<T>::parse(const QString &xml)
68{
69 typename T::Parser p;
70 m_item = p.parse(xml);
71 setMetadata(p.metadata());
72}
73
74template<class T>
76{
77 return m_item;
78}
79
80template<class T>
81ItemPutJob<T>::ItemPutJob(PlatformDependent *internals, const QNetworkRequest &request, QIODevice *data)
82 : PutJob(internals, request, data)
83{
84}
85
86template<class T>
87ItemPutJob<T>::ItemPutJob(PlatformDependent *internals, const QNetworkRequest &request, const StringMap &parameters)
88 : PutJob(internals, request, parameters)
89{
90}
91
92template<class T>
93void ItemPutJob<T>::parse(const QString &xml)
94{
95 typename T::Parser p;
96 m_item = p.parse(xml);
97 setMetadata(p.metadata());
98}
99
100template<class T>
101T ItemPutJob<T>::result() const
102{
103 return m_item;
104}
Represents a delete job.
Definition deletejob.h:26
Represents a get job.
Definition getjob.h:26
Represents an item delete job.
Definition itemjob.h:48
Represents an item get job.
Definition itemjob.h:30
Represents an item post job.
Definition itemjob.h:66
Represents an item put job.
Definition itemjob.h:86
Represents a post job.
Definition postjob.h:30
Represents a put job.
Definition putjob.h:30
The Attica namespace,.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:17:36 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.