fixed next/prev screen pb + pb with accents when matching in preview

This commit is contained in:
dockes
2005-02-08 11:59:09 +00:00
parent 4588803281
commit 3649eb415b
4 changed files with 88 additions and 36 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
#ifndef lint
static char rcsid[] = "@(#$Id: rcldb.cpp,v 1.21 2005-02-08 10:56:12 dockes Exp $ (C) 2004 J.F.Dockes";
static char rcsid[] = "@(#$Id: rcldb.cpp,v 1.22 2005-02-08 11:59:08 dockes Exp $ (C) 2004 J.F.Dockes";
#endif
#include <stdio.h>
#include <sys/stat.h>
@@ -205,7 +205,7 @@ bool mySplitterCB::takeword(const std::string &term, int pos, int, int)
// for accents, and do it by hand for upper / lower. Note lowercasing is
// only for ascii letters anyway, so it's just A-Z -> a-z
// Removing crlfs is so that we can use the text in the document data fields.
bool dumb_string(const string &in, string &out)
bool Rcl::dumb_string(const string &in, string &out)
{
string inter;
out.erase();
+20 -14
View File
@@ -1,10 +1,14 @@
#ifndef _DB_H_INCLUDED_
#define _DB_H_INCLUDED_
/* @(#$Id: rcldb.h,v 1.9 2005-02-07 13:17:47 dockes Exp $ (C) 2004 J.F.Dockes */
/* @(#$Id: rcldb.h,v 1.10 2005-02-08 11:59:08 dockes Exp $ (C) 2004 J.F.Dockes */
#include <string>
#include <list>
#ifndef NO_NAMESPACES
using std::string;
#endif
// rcldb defines an interface for a 'real' text database. The current
// implementation uses xapian only, and xapian-related code is in rcldb.cpp
// If support was added for other backend, the xapian code would be moved in
@@ -28,15 +32,15 @@ namespace Rcl {
class Doc {
public:
// This fields potentially go into the document data record
std::string url;
std::string mimetype;
std::string mtime; // Modification time as decimal ascii
std::string origcharset;
std::string title;
std::string keywords;
std::string abstract;
string url;
string mimetype;
string mtime; // Modification time as decimal ascii
string origcharset;
string title;
string keywords;
string abstract;
std::string text;
string text;
void erase() {
url.erase();
mimetype.erase();
@@ -60,20 +64,20 @@ class Db {
Db();
~Db();
enum OpenMode {DbRO, DbUpd, DbTrunc};
bool open(const std::string &dbdir, OpenMode mode);
bool open(const string &dbdir, OpenMode mode);
bool close();
bool isopen();
// Update-related functions
bool add(const std::string &filename, const Doc &doc);
bool needUpdate(const std::string &filename, const struct stat *stp);
bool add(const string &filename, const Doc &doc);
bool needUpdate(const string &filename, const struct stat *stp);
bool purge();
// Query-related functions
// Parse query string and initialize query
bool setQuery(const std::string &q);
bool getQueryTerms(std::list<std::string>& terms);
bool setQuery(const string &q);
bool getQueryTerms(std::list<string>& terms);
// Get document at rank i. This is probably vastly inferior to the type
// of interface in Xapian, but we have to start with something simple
@@ -83,6 +87,8 @@ class Db {
int getResCnt();
};
// Unaccent and lowercase data.
extern bool dumb_string(const string &in, string &out);
}