"Fossies" - the Fresh Open Source Software Archive

Member "cb2bib-2.0.1/src/c2b/documentCache.h" (12 Feb 2021, 1218 Bytes) of package /linux/privat/cb2bib-2.0.1.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "documentCache.h" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 2.0.0_vs_2.0.1.

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