Marble

DiscCache.h
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2007 Tobias Koenig <tokoe@kde.org>
4//
5
6#ifndef MARBLE_DISCCACHE_H
7#define MARBLE_DISCCACHE_H
8
9#include <QDateTime>
10#include <QMap>
11#include <QPair>
12#include <QString>
13
14class QByteArray;
15
16namespace Marble
17{
18
19class DiscCache
20{
21 public:
22 explicit DiscCache( const QString &cacheDirectory );
23 ~DiscCache();
24
25 quint64 cacheLimit() const;
26 void clear();
27 bool exists( const QString &key ) const;
28 bool find( const QString &key, QByteArray &data );
29 bool insert( const QString &key, const QByteArray &data );
30 void remove( const QString &key );
31 void setCacheLimit( quint64 n );
32
33 private:
34 QString keyToFileName( const QString& ) const;
35 void cleanup();
36
37 QString m_CacheDirectory;
38 quint64 m_CacheLimit;
39 quint64 m_CurrentCacheSize;
40
41 typedef QPair<QDateTime, quint64> Entry;
42 QMap<QString, Entry> m_Entries;
43};
44
45}
46
47#endif
Binds a QML item to a specific geodetic location in screen coordinates.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Jul 12 2024 11:58:54 by doxygen 1.11.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.