Switch to unified view

a/src/rcldb/rcldb.h b/src/rcldb/rcldb.h
...
...
14
 *   Free Software Foundation, Inc.,
14
 *   Free Software Foundation, Inc.,
15
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
15
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
16
 */
16
 */
17
#ifndef _DB_H_INCLUDED_
17
#ifndef _DB_H_INCLUDED_
18
#define _DB_H_INCLUDED_
18
#define _DB_H_INCLUDED_
19
/* @(#$Id: rcldb.h,v 1.63 2008-09-29 08:59:20 dockes Exp $  (C) 2004 J.F.Dockes */
19
/* @(#$Id: rcldb.h,v 1.64 2008-12-17 08:01:40 dockes Exp $  (C) 2004 J.F.Dockes */
20
20
21
#include <string>
21
#include <string>
22
#include <list>
22
#include <list>
23
#include <vector>
23
#include <vector>
24
24
...
...
48
// source storage (file system or other). Used for up to date checks
48
// source storage (file system or other). Used for up to date checks
49
// etc. "udi". Our user is responsible for making sure it's not too
49
// etc. "udi". Our user is responsible for making sure it's not too
50
// big, cause it's stored as a Xapian term (< 150 bytes would be
50
// big, cause it's stored as a Xapian term (< 150 bytes would be
51
// reasonable)
51
// reasonable)
52
52
53
class RclConfig;
54
53
#ifndef NO_NAMESPACES
55
#ifndef NO_NAMESPACES
54
namespace Rcl {
56
namespace Rcl {
55
#endif
57
#endif
56
58
57
class SearchData;
59
class SearchData;
...
...
78
    // A place for things we don't want visible here.
80
    // A place for things we don't want visible here.
79
    class Native;
81
    class Native;
80
    friend class Native;
82
    friend class Native;
81
83
82
    /* General stuff (valid for query or update) ****************************/
84
    /* General stuff (valid for query or update) ****************************/
83
    Db();
85
    Db(RclConfig *cfp);
84
    ~Db();
86
    ~Db();
85
87
86
    enum OpenMode {DbRO, DbUpd, DbTrunc};
88
    enum OpenMode {DbRO, DbUpd, DbTrunc};
87
    bool open(const string &dbdir, const string &stoplistfn, 
88
        OpenMode mode, bool keep_updated = false);
89
    bool open(OpenMode mode, bool keep_updated = false);
89
    bool close();
90
    bool close();
90
    bool isopen();
91
    bool isopen();
91
92
92
    /** Get explanation about last error */
93
    /** Get explanation about last error */
93
    string getReason() const {return m_reason;}
94
    string getReason() const {return m_reason;}
...
...
192
193
193
private:
194
private:
194
    // Internal form of close, can be called during destruction
195
    // Internal form of close, can be called during destruction
195
    bool i_close(bool final);
196
    bool i_close(bool final);
196
197
198
    RclConfig *m_config;
197
    string m_reason; // Error explanation
199
    string     m_reason; // Error explanation
198
200
199
    /* Parameters cached out of the configuration files */
201
    /* Parameters cached out of the configuration files */
200
    // This is how long an abstract we keep or build from beginning of
202
    // This is how long an abstract we keep or build from beginning of
201
    // text when indexing. It only has an influence on the size of the
203
    // text when indexing. It only has an influence on the size of the
202
    // db as we are free to shorten it again when displaying
204
    // db as we are free to shorten it again when displaying