1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
|
/***************************************************************************
* Copyright (C) 2004-2015 by Pere Constans
* constans@molspaces.com
* cb2Bib version 1.9.2. Licensed under the GNU GPL version 3.
* See the LICENSE file that comes with this distribution.
***************************************************************************/
#ifndef DOCUMENTCACHE_H
#define DOCUMENTCACHE_H
#include "documentContents.h"
#include <QHash>
class settings;
class documentCache
{
public:
documentCache();
~documentCache();
bool setCurrent(const QString& fn);
bool setCurrent(const QString& fn, int* pdfCounter, QString* logString, int* errorCounter);
void load(const QString& fn, const documentContents::Type type);
void unload();
inline const documentContents& current() const
{
return _current;
}
inline const QHash<QString, QByteArray>& cacheData() const
{
return _cache;
}
private:
QHash<QString, QByteArray> _cache;
QString _cache_filename;
QString _load_filename;
documentContents _current;
documentContents::Type _content_type;
int _cache_load_size;
settings* _settingsP;
void save();
};
#endif
|