|
a/src/rcldb/rcldb_p.h |
|
b/src/rcldb/rcldb_p.h |
|
... |
|
... |
2 |
#define _rcldb_p_h_included_
|
2 |
#define _rcldb_p_h_included_
|
3 |
|
3 |
|
4 |
#include "xapian.h"
|
4 |
#include "xapian.h"
|
5 |
|
5 |
|
6 |
namespace Rcl {
|
6 |
namespace Rcl {
|
7 |
/* @(#$Id: rcldb_p.h,v 1.5 2008-09-16 08:18:30 dockes Exp $ (C) 2007 J.F.Dockes */
|
7 |
/* @(#$Id: rcldb_p.h,v 1.6 2008-09-30 12:38:29 dockes Exp $ (C) 2007 J.F.Dockes */
|
8 |
|
8 |
|
9 |
// Generic Xapian exception catching code. We do this quite often,
|
9 |
// Generic Xapian exception catching code. We do this quite often,
|
10 |
// and I have no idea how to do this except for a macro
|
10 |
// and I have no idea how to do this except for a macro
|
11 |
#define XCATCHERROR(MSG) \
|
11 |
#define XCATCHERROR(MSG) \
|
12 |
catch (const Xapian::Error &e) { \
|
12 |
catch (const Xapian::Error &e) { \
|
|
... |
|
... |
28 |
// Xapian-specific stuff if they were in Rcl::Db. There could actually be
|
28 |
// Xapian-specific stuff if they were in Rcl::Db. There could actually be
|
29 |
// 2 different ones for indexing or query as there is not much in
|
29 |
// 2 different ones for indexing or query as there is not much in
|
30 |
// common.
|
30 |
// common.
|
31 |
class Db::Native {
|
31 |
class Db::Native {
|
32 |
public:
|
32 |
public:
|
33 |
Db *m_db;
|
33 |
Db *m_db;
|
34 |
bool m_isopen;
|
34 |
bool m_isopen;
|
35 |
bool m_iswritable;
|
35 |
bool m_iswritable;
|
36 |
|
36 |
bool m_noversionwrite; //Set if open failed because of version mismatch!
|
37 |
// Indexing
|
37 |
// Indexing
|
38 |
Xapian::WritableDatabase wdb;
|
38 |
Xapian::WritableDatabase wdb;
|
39 |
|
39 |
|
40 |
// Querying
|
40 |
// Querying
|
41 |
Xapian::Database db;
|
41 |
Xapian::Database db;
|
42 |
|
42 |
|
43 |
Native(Db *db)
|
43 |
Native(Db *db)
|
44 |
: m_db(db), m_isopen(false), m_iswritable(false)
|
44 |
: m_db(db), m_isopen(false), m_iswritable(false),m_noversionwrite(false)
|
45 |
{ }
|
45 |
{ }
|
46 |
|
46 |
|
47 |
~Native() {
|
47 |
~Native() {
|
48 |
}
|
48 |
}
|
49 |
|
49 |
|