• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

marble

  • sources
  • kde-4.14
  • kdeedu
  • marble
  • src
  • lib
  • marble
DiscCache.h
Go to the documentation of this file.
1 //
2 // This file is part of the Marble Virtual Globe.
3 //
4 // This program is free software licensed under the GNU LGPL. You can
5 // find a copy of this license in LICENSE.txt in the top directory of
6 // the source code.
7 //
8 // Copyright 2007 Tobias Koenig <tokoe@kde.org>
9 //
10 
11 #ifndef MARBLE_DISCCACHE_H
12 #define MARBLE_DISCCACHE_H
13 
14 #include <QDateTime>
15 #include <QMap>
16 #include <QPair>
17 #include <QString>
18 
19 class QByteArray;
20 
21 namespace Marble
22 {
23 
24 class DiscCache
25 {
26  public:
27  explicit DiscCache( const QString &cacheDirectory );
28  ~DiscCache();
29 
30  quint64 cacheLimit() const;
31  void clear();
32  bool exists( const QString &key ) const;
33  bool find( const QString &key, QByteArray &data );
34  bool insert( const QString &key, const QByteArray &data );
35  void remove( const QString &key );
36  void setCacheLimit( quint64 n );
37 
38  private:
39  QString keyToFileName( const QString& ) const;
40  void cleanup();
41 
42  QString m_CacheDirectory;
43  quint64 m_CacheLimit;
44  quint64 m_CurrentCacheSize;
45 
46  typedef QPair<QDateTime, quint64> Entry;
47  QMap<QString, Entry> m_Entries;
48 };
49 
50 }
51 
52 #endif
QByteArray
QMap
Marble::DiscCache::cacheLimit
quint64 cacheLimit() const
Definition: DiscCache.cpp:67
Marble::DiscCache::DiscCache
DiscCache(const QString &cacheDirectory)
Definition: DiscCache.cpp:27
QString
QPair
Marble::DiscCache::setCacheLimit
void setCacheLimit(quint64 n)
Definition: DiscCache.cpp:159
Marble::DiscCache::find
bool find(const QString &key, QByteArray &data)
Definition: DiscCache.cpp:98
Marble::DiscCache::clear
void clear()
Definition: DiscCache.cpp:72
Marble::DiscCache::exists
bool exists(const QString &key) const
Definition: DiscCache.cpp:93
Marble::DiscCache::insert
bool insert(const QString &key, const QByteArray &data)
Definition: DiscCache.cpp:116
Marble::DiscCache::~DiscCache
~DiscCache()
Definition: DiscCache.cpp:51
Marble::DiscCache
Definition: DiscCache.h:24
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:13:38 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

marble

Skip menu "marble"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal