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// Qt-Security score:significant reason:default
5
6#ifndef QCOAPRESOURCE_H
7#define QCOAPRESOURCE_H
8
9#include <QtCoap/qcoapglobal.h>
10#include <QtCore/qshareddata.h>
11#include <QtNetwork/qhostaddress.h>
12
13#ifdef interface
14# undef interface
15#endif
16
17QT_BEGIN_NAMESPACE
18
19class QCoapResourcePrivate;
20
21class Q_COAP_EXPORT QCoapResource
22{
23public:
24 QCoapResource();
25 QCoapResource(const QCoapResource &other);
26 ~QCoapResource();
27 QCoapResource &operator =(const QCoapResource &other);
28
29 void swap(QCoapResource &other) noexcept;
30
31 QHostAddress host() const;
32 QString path() const;
33 QString title() const;
34 bool observable() const;
35 QString resourceType() const;
36 QString interface() const;
37 int maximumSize() const;
38 uint contentFormat() const;
39
40 void setHost(const QHostAddress &host);
41 void setPath(const QString &path);
42 void setTitle(const QString &title);
43 void setObservable(bool observable);
44 void setResourceType(const QString &resourceType);
45 void setInterface(const QString &interface);
46 void setMaximumSize(int maximumSize);
47 void setContentFormat(uint contentFormat);
48
49private:
50 QSharedDataPointer<QCoapResourcePrivate> d;
51};
52
53Q_DECLARE_SHARED(QCoapResource)
54
55QT_END_NAMESPACE
56
57#endif // QCOAPRESOURCE_H
58

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