Switch to unified view

a/src/query/xadump.cpp b/src/query/xadump.cpp
...
...
114
    fprintf(stderr, "sigcleanup\n");
114
    fprintf(stderr, "sigcleanup\n");
115
    cleanup();
115
    cleanup();
116
    exit(1);
116
    exit(1);
117
}
117
}
118
118
119
#ifndef RCL_INDEX_STRIPCHARS
120
bool o_index_stripchars;
119
bool o_index_stripchars;
121
#endif
122
120
123
inline bool has_prefix(const string& trm)
121
inline bool has_prefix(const string& trm)
124
{
122
{
125
#ifndef RCL_INDEX_STRIPCHARS
126
    if (o_index_stripchars) {
123
    if (o_index_stripchars) {
127
#endif
128
    return trm.size() && 'A' <= trm[0] && trm[0] <= 'Z';
124
    return trm.size() && 'A' <= trm[0] && trm[0] <= 'Z';
129
#ifndef RCL_INDEX_STRIPCHARS
130
    } else {
125
    } else {
131
    return trm.size() > 0 && trm[0] == ':';
126
    return trm.size() > 0 && trm[0] == ':';
132
    }
127
    }
133
#endif
134
}
128
}
135
129
136
int main(int argc, char **argv)
130
int main(int argc, char **argv)
137
{
131
{
138
    string dbdir = path_cat(path_home(), ".recoll/xapiandb");
132
    string dbdir = path_cat(path_home(), ".recoll/xapiandb");
...
...
210
    try {
204
    try {
211
    db = new Xapian::Database(dbdir);
205
    db = new Xapian::Database(dbdir);
212
    cout << "DB: ndocs " << db->get_doccount() << " lastdocid " <<
206
    cout << "DB: ndocs " << db->get_doccount() << " lastdocid " <<
213
        db->get_lastdocid() << " avglength " << db->get_avlength() << endl;
207
        db->get_lastdocid() << " avglength " << db->get_avlength() << endl;
214
208
215
#ifndef RCL_INDEX_STRIPCHARS
216
    // If we have terms with a leading ':' it's a new style,
209
    // If we have terms with a leading ':' it's a new style,
217
    // unstripped index
210
    // unstripped index
218
    {
211
    {
219
        Xapian::TermIterator term = db->allterms_begin(":");
212
        Xapian::TermIterator term = db->allterms_begin(":");
220
        if (term == db->allterms_end())
213
        if (term == db->allterms_end())
221
        o_index_stripchars = true;
214
        o_index_stripchars = true;
222
        else
215
        else
223
        o_index_stripchars = false;
216
        o_index_stripchars = false;
224
        cout<<"DB: terms are "<<(o_index_stripchars?"stripped":"raw")<<endl;
217
        cout<<"DB: terms are "<<(o_index_stripchars?"stripped":"raw")<<endl;
225
    }
218
    }
226
#endif
227
    
219
    
228
    if (op_flags & OPT_T) {
220
    if (op_flags & OPT_T) {
229
        Xapian::TermIterator term;
221
        Xapian::TermIterator term;
230
        string printable;
222
        string printable;
231
        string op = (op_flags & OPT_n) ? string(): "[";
223
        string op = (op_flags & OPT_n) ? string(): "[";