00001
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include <config.h>
00022
00023 #include "inmemory_document.h"
00024
00025 #include "inmemory_database.h"
00026
00027 #include "debuglog.h"
00028
00029 string
00030 InMemoryDocument::do_get_value(Xapian::valueno slot) const
00031 {
00032 LOGCALL(DB, string, "InMemoryDocument::do_get_value", slot);
00033 const InMemoryDatabase * db;
00034 db = static_cast<const InMemoryDatabase*>(database.get());
00035 map<Xapian::valueno, string> values_ = db->valuelists[did - 1];
00036 map<Xapian::valueno, string>::const_iterator i;
00037 i = values_.find(slot);
00038 if (i == values_.end())
00039 RETURN(string());
00040 RETURN(i->second);
00041 }
00042
00043 void
00044 InMemoryDocument::do_get_all_values(map<Xapian::valueno, string> &values_) const
00045 {
00046 LOGCALL_VOID(DB, "InMemoryDocument::do_get_all_values", values_);
00047 const InMemoryDatabase * db;
00048 db = static_cast<const InMemoryDatabase*>(database.get());
00049 if (db->closed) InMemoryDatabase::throw_database_closed();
00050 values_ = db->valuelists[did - 1];
00051 }
00052
00053 string
00054 InMemoryDocument::do_get_data() const
00055 {
00056 LOGCALL(DB, string, "InMemoryDocument::do_get_data", NO_ARGS);
00057 const InMemoryDatabase * db;
00058 db = static_cast<const InMemoryDatabase*>(database.get());
00059 if (db->closed) InMemoryDatabase::throw_database_closed();
00060 RETURN(db->doclists[did - 1]);
00061 }