--- a/src/utils/circache.h
+++ b/src/utils/circache.h
@@ -1,13 +1,28 @@
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
#ifndef _circache_h_included_
#define _circache_h_included_
/* @(#$Id: $ (C) 2009 J.F.Dockes */
/**
* A data cache implemented as a circularly managed file
*
- * This is used to store cached remote pages for recoll. A single file is used
- * to store the compressed pages and the associated metadata. The file
- * grows to a specified maximum size, then is rewritten from the
- * start, overwriting older entries.
+ * A single file is used to stored objects. The file grows to a
+ * specified maximum size, then is rewritten from the start,
+ * overwriting older entries.
*
* Data objects inside the cache each have two parts: a data segment and an
* attribute (metadata) dictionary.
@@ -30,20 +45,24 @@
class CirCache {
public:
CirCache(const string& dir);
- ~CirCache();
+ virtual ~CirCache();
- string getReason();
+ virtual string getReason();
- bool create(off_t maxsize);
+ virtual bool create(off_t maxsize);
enum OpMode {CC_OPREAD, CC_OPWRITE};
- bool open(OpMode mode);
+ virtual bool open(OpMode mode);
- bool get(const string& udi, string dic, string data);
+ virtual bool get(const string& udi, string& dic, string& data,
+ int instance = -1);
- bool put(const string& udi, const string& dic, const string& data);
+ virtual bool put(const string& udi, const string& dic, const string& data);
-private:
+ /* Debug */
+ virtual bool dump();
+
+protected:
CirCacheInternal *m_d;
string m_dir;
};