Logo Search packages:      
Sourcecode: earth3d version File versions  Download package

FileCache Class Reference

#include <fileCache.h>

List of all members.


Detailed Description

This is a cache that saves downloaded files in a directory up to a given size. It uses a simple scheme: Every files that is requested is saved (or moved when it already exists) to the top of the cache list. When the cache is full, entries from the bottom are removed. The list is saved after every successful download and after 10 cache hits.

Definition at line 17 of file fileCache.h.


Public Member Functions

void addFile (QString url, QByteArray &ba)
bool contains (QString url)
float getUsedSizeMB ()
void loadCache ()
QByteArray read (QString url)
virtual void run ()
void saveCache ()
void setCacheLocation (QString path)

Protected Member Functions

void checkCacheIndex ()
void checkCacheSize ()
QString createFilename (QString url)
int getFileSize (QString filename)
long getUsedSizeBytes ()
QString hexString (uint8 value)
void loadCacheIndex (QString filename)
void mkpath (QString directory)
void removeFile (QString filename)
void rmpath (QString filename)

Protected Attributes

QString cacheIndexFilename
QString cacheLocation
bool dirty
QValueList< QString > files
QMap< QString, int > filesizes

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index