| 1 | // Copyright (C) 2016 The Qt Company Ltd. |
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
| 3 | |
| 4 | #ifndef QNETWORKACCESSCACHEBACKEND_P_H |
| 5 | #define QNETWORKACCESSCACHEBACKEND_P_H |
| 6 | |
| 7 | // |
| 8 | // W A R N I N G |
| 9 | // ------------- |
| 10 | // |
| 11 | // This file is not part of the Qt API. It exists for the convenience |
| 12 | // of the Network Access API. This header file may change from |
| 13 | // version to version without notice, or even be removed. |
| 14 | // |
| 15 | // We mean it. |
| 16 | // |
| 17 | |
| 18 | #include <QtNetwork/private/qtnetworkglobal_p.h> |
| 19 | #include "qnetworkaccessbackend_p.h" |
| 20 | #include "qnetworkrequest.h" |
| 21 | #include "qnetworkreply.h" |
| 22 | |
| 23 | QT_BEGIN_NAMESPACE |
| 24 | |
| 25 | class QNetworkAccessCacheBackend : public QNetworkAccessBackend |
| 26 | { |
| 27 | |
| 28 | public: |
| 29 | QNetworkAccessCacheBackend(); |
| 30 | ~QNetworkAccessCacheBackend(); |
| 31 | |
| 32 | void open() override; |
| 33 | void close() override; |
| 34 | bool start() override; |
| 35 | qint64 bytesAvailable() const override; |
| 36 | qint64 read(char *data, qint64 maxlen) override; |
| 37 | |
| 38 | private: |
| 39 | bool sendCacheContents(); |
| 40 | |
| 41 | QIODevice *device = nullptr; |
| 42 | }; |
| 43 | |
| 44 | QT_END_NAMESPACE |
| 45 | |
| 46 | #endif // QNETWORKACCESSCACHEBACKEND_P_H |
| 47 | |