18#ifndef QGSRANGEREQUESTCACHE_H
19#define QGSRANGEREQUESTCACHE_H
25#include <QFileInfoList>
27#include <QNetworkRequest>
49 bool hasEntry(
const QNetworkRequest &request );
51 QByteArray
entry(
const QNetworkRequest &request );
53 void registerEntry(
const QNetworkRequest &request, QByteArray data );
68 QString
error()
const {
return mError; }
74 qint64 mMaxDataSize = 256 * 1024 * 1024;
76 QString rangeFileName(
const QNetworkRequest &request )
const;
78 QByteArray readFile(
const QString &fileName );
79 bool writeFile(
const QString &fileName, QByteArray data );
80 bool removeFile(
const QString &fileName );
84 QFileInfoList cacheEntries();
friend class TestQgsCopcProvider
void clear()
Clears the cache removing all of the files.
bool hasEntry(const QNetworkRequest &request)
Checks whether the range request exists in the cache.
QString error() const
Returns the last error that occurred when manipulating the cache.
bool setCacheDirectory(const QString &path)
Set the Cache Directory object.
QByteArray entry(const QNetworkRequest &request)
Returns the range request data stored in the cache and an empty byte array if the data is not in the ...
void registerEntry(const QNetworkRequest &request, QByteArray data)
Adds the range request data into the cache.
void setCacheSize(qint64 maxBytes)
Sets the cache size.