Beaglequeue: simplify index from cache now that udi entries are unique in cache

This commit is contained in:
dockes
2009-11-23 16:10:38 +00:00
parent 7f856f482b
commit 3c40b0bb1e
3 changed files with 20 additions and 31 deletions
+5 -4
View File
@@ -508,7 +508,7 @@ public:
if (!readDicData(hoffs, d, dic, 0))
return false;
if (d.dicsize == 0) {
// This is an erase entry
// This is an erased entry
udi.erase();
return true;
}
@@ -1082,15 +1082,16 @@ bool CirCache::next(bool& eof)
return false;
}
bool CirCache::getcurrentdict(string& dic)
bool CirCache::getCurrentUdi(string& udi)
{
assert(m_d != 0);
if (!m_d->readDicData(m_d->m_itoffs, m_d->m_ithd, dic, 0))
if (!m_d->readHUdi(m_d->m_itoffs, m_d->m_ithd, udi))
return false;
return true;
}
bool CirCache::getcurrent(string& udi, string& dic, string& data)
bool CirCache::getCurrent(string& udi, string& dic, string& data)
{
assert(m_d != 0);
if (!m_d->readDicData(m_d->m_itoffs, m_d->m_ithd, dic, &data))
+4 -3
View File
@@ -84,9 +84,10 @@ public:
/** Back to oldest */
virtual bool rewind(bool& eof);
/** Get entry under cursor */
virtual bool getcurrent(string& udi, string& dic, string& data);
/** Get current entry dict only (ie: udi is in dict */
virtual bool getcurrentdict(string& dict);
virtual bool getCurrent(string& udi, string& dic, string& data);
/** Get current entry udi only. Udi can be empty (erased empty), caller
* should call again */
virtual bool getCurrentUdi(string& udi);
/** Skip to next. (false && !eof) -> error, (false&&eof)->EOF. */
virtual bool next(bool& eof);