fix problems with doc fetch sequence (have to know where to stop)

This commit is contained in:
dockes
2006-02-07 10:26:49 +00:00
parent cf07573b57
commit b20222b150
5 changed files with 44 additions and 20 deletions
+4 -4
View File
@@ -1,5 +1,5 @@
#ifndef lint
static char rcsid[] = "@(#$Id: docseq.cpp,v 1.7 2006-01-26 12:30:14 dockes Exp $ (C) 2005 J.F.Dockes";
static char rcsid[] = "@(#$Id: docseq.cpp,v 1.8 2006-02-07 10:26:49 dockes Exp $ (C) 2005 J.F.Dockes";
#endif
/*
* This program is free software; you can redistribute it and/or modify
@@ -38,9 +38,9 @@ int DocSequenceDb::getResCnt()
return m_rescnt;
}
bool DocSequenceHistory::getDoc(int num, Rcl::Doc &doc, int *percent,
string *sh) {
string *sh)
{
// Retrieve history list
if (!m_hist)
return false;
@@ -72,7 +72,7 @@ bool DocSequenceHistory::getDoc(int num, Rcl::Doc &doc, int *percent,
} else
sh->erase();
}
return m_db->getDoc(m_it->fn, m_it->ipath, doc);
return m_db->getDoc(m_it->fn, m_it->ipath, doc, percent);
}
int DocSequenceHistory::getResCnt()
+14 -1
View File
@@ -16,7 +16,7 @@
*/
#ifndef _DOCSEQ_H_INCLUDED_
#define _DOCSEQ_H_INCLUDED_
/* @(#$Id: docseq.h,v 1.5 2006-01-30 11:15:28 dockes Exp $ (C) 2004 J.F.Dockes */
/* @(#$Id: docseq.h,v 1.6 2006-02-07 10:26:49 dockes Exp $ (C) 2004 J.F.Dockes */
#include "rcldb.h"
#include "history.h"
@@ -31,6 +31,19 @@ class DocSequence {
public:
DocSequence(const std::string &t) : m_title(t) {}
virtual ~DocSequence() {}
/** Get document at given rank
*
* @param num document rank in sequence
* @param doc return data
* @param percent this will be updated with the percentage of relevance, if
* available, depending on the type of sequence. Return -1 in there
* to indicate that the specified document data is
* unavailable but that there may be available data further
* in the sequence
* @param sh subheader to display before this result (ie: date change
* inside history)
* @return true if ok, false for error or end of data
*/
virtual bool getDoc(int num, Rcl::Doc &doc, int *percent, string *sh = 0)
= 0;
virtual int getResCnt() = 0;