1// Copyright (C) 2017 Witekio.
2// Copyright (C) 2018 The Qt Company Ltd.
3// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
4
5#ifndef QCOAPRESOURCE_H
6#define QCOAPRESOURCE_H
7
8#include <QtCoap/qcoapglobal.h>
9#include <QtCore/qshareddata.h>
10#include <QtNetwork/qhostaddress.h>
11
12#ifdef interface
13# undef interface
14#endif
15
16QT_BEGIN_NAMESPACE
17
18class QCoapResourcePrivate;
19
20class Q_COAP_EXPORT QCoapResource
21{
22public:
23 QCoapResource();
24 QCoapResource(const QCoapResource &other);
25 ~QCoapResource();
26 QCoapResource &operator =(const QCoapResource &other);
27
28 void swap(QCoapResource &other) noexcept;
29
30 QHostAddress host() const;
31 QString path() const;
32 QString title() const;
33 bool observable() const;
34 QString resourceType() const;
35 QString interface() const;
36 int maximumSize() const;
37 uint contentFormat() const;
38
39 void setHost(const QHostAddress &host);
40 void setPath(const QString &path);
41 void setTitle(const QString &title);
42 void setObservable(bool observable);
43 void setResourceType(const QString &resourceType);
44 void setInterface(const QString &interface);
45 void setMaximumSize(int maximumSize);
46 void setContentFormat(uint contentFormat);
47
48private:
49 QSharedDataPointer<QCoapResourcePrivate> d;
50};
51
52Q_DECLARE_SHARED(QCoapResource)
53
54QT_END_NAMESPACE
55
56#endif // QCOAPRESOURCE_H
57

source code of qtcoap/src/coap/qcoapresource.h