diff options
| author | Linus Jahn <lnj@kaidan.im> | 2022-09-14 00:06:51 +0200 |
|---|---|---|
| committer | Linus Jahn <lnj@kaidan.im> | 2022-09-14 00:38:06 +0200 |
| commit | 2a856cc4a2edc2496eed674f7c2912619738522a (patch) | |
| tree | 525b779d26b2b631513db2e38c237e0ef00cc5f0 /src/base/QXmppHttpFileSource.h | |
| parent | f672197ba23de12ca6639dccce339c0205a87be5 (diff) | |
| download | qxmpp-2a856cc4a2edc2496eed674f7c2912619738522a.tar.gz | |
Add extra class for HttpFileSource instead of using QUrl
Before just QUrl was used, which was okay. This should make it better
recognizable and it makes clear it is only used for HTTP urls.
Diffstat (limited to 'src/base/QXmppHttpFileSource.h')
| -rw-r--r-- | src/base/QXmppHttpFileSource.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/base/QXmppHttpFileSource.h b/src/base/QXmppHttpFileSource.h new file mode 100644 index 00000000..af914fb2 --- /dev/null +++ b/src/base/QXmppHttpFileSource.h @@ -0,0 +1,35 @@ +// SPDX-FileCopyrightText: 2022 Linus Jahn <lnj@kaidan.im> +// +// SPDX-License-Identifier: LGPL-2.1-or-later + +#ifndef QXMPPHTTPFILESOURCE_H +#define QXMPPHTTPFILESOURCE_H + +#include "QXmppGlobal.h" + +#include <QUrl> + +class QDomElement; +class QXmlStreamWriter; + +class QXMPP_EXPORT QXmppHttpFileSource +{ +public: + QXmppHttpFileSource(); + QXmppHttpFileSource(QUrl url); + QXMPP_PRIVATE_DECLARE_RULE_OF_SIX(QXmppHttpFileSource) + + const QUrl &url() const; + void setUrl(QUrl url); + + /// \cond + bool parse(const QDomElement &el); + void toXml(QXmlStreamWriter *writer) const; + /// \endcond + +private: + static_assert(sizeof(QUrl) == sizeof(void *)); + QUrl m_url; +}; + +#endif // QXMPPHTTPFILESOURCE_H |
