Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
qnetworkaccessfilebackend_p.h
Go to the documentation of this file.
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
// Qt-Security score:significant reason:default
4
5
#
ifndef
QNETWORKACCESSFILEBACKEND_P_H
6
#
define
QNETWORKACCESSFILEBACKEND_P_H
7
8
//
9
// W A R N I N G
10
// -------------
11
//
12
// This file is not part of the Qt API. It exists for the convenience
13
// of the Network Access API. This header file may change from
14
// version to version without notice, or even be removed.
15
//
16
// We mean it.
17
//
18
19
#
include
<
QtNetwork
/
private
/
qtnetworkglobal_p
.
h
>
20
#
include
"qnetworkaccessbackend_p.h"
21
#
include
"qnetworkrequest.h"
22
#
include
"qnetworkreply.h"
23
#
include
"QtCore/qfile.h"
24
25
QT_BEGIN_NAMESPACE
26
27
class
QNetworkAccessFileBackend:
public
QNetworkAccessBackend
28
{
29
Q_OBJECT
30
public
:
31
QNetworkAccessFileBackend();
32
virtual
~QNetworkAccessFileBackend();
33
34
void
open() override;
35
void
close() override;
36
37
qint64 bytesAvailable()
const
override;
38
qint64 read(
char
*data, qint64 maxlen) override;
39
40
public
slots:
41
void
uploadReadyReadSlot();
42
private
:
43
QFile file;
44
qint64 totalBytes;
45
bool
hasUploadFinished;
46
47
bool
loadFileInfo();
48
};
49
50
class
QNetworkAccessFileBackendFactory
:
public
QNetworkAccessBackendFactory
51
{
52
public
:
53
virtual
QStringList
supportedSchemes
()
const
override
;
54
virtual
QNetworkAccessBackend
*
create
(QNetworkAccessManager::Operation op,
55
const
QNetworkRequest &request)
const
override
;
56
};
57
58
QT_END_NAMESPACE
59
60
#
endif
QFileInfo
Definition
qfileinfo.h:26
QNetworkAccessFileBackendFactory
Definition
qnetworkaccessfilebackend_p.h:51
QNetworkAccessFileBackendFactory::create
virtual QNetworkAccessBackend * create(QNetworkAccessManager::Operation op, const QNetworkRequest &request) const override
Override this method in your own class and return a heap-allocated instance of your class derived fro...
Definition
qnetworkaccessfilebackend.cpp:29
QNetworkAccessFileBackendFactory::supportedSchemes
virtual QStringList supportedSchemes() const override
Override this method in your own derived class to let Qt know what schemes your class can handle.
Definition
qnetworkaccessfilebackend.cpp:17
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
qtbase
src
network
access
qnetworkaccessfilebackend_p.h
Generated on
for Qt by
1.18.0