backends/remote/net_document.cc

Go to the documentation of this file.
00001 /* net_document.cc: C++ class for storing net documents
00002  *
00003  * ----START-LICENCE----
00004  * Copyright 1999,2000,2001 BrightStation PLC
00005  * Copyright 2002 Ananova Ltd
00006  * Copyright 2003 Olly Betts
00007  *
00008  * This program is free software; you can redistribute it and/or
00009  * modify it under the terms of the GNU General Public License as
00010  * published by the Free Software Foundation; either version 2 of the
00011  * License, or (at your option) any later version.
00012  *
00013  * This program is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016  * GNU General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU General Public License
00019  * along with this program; if not, write to the Free Software
00020  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00021  * USA
00022  * -----END-LICENCE-----
00023  */
00024 
00025 #include <config.h>
00026 #include "net_document.h"
00027 #include "omdebug.h"
00028 
00029 NetworkDocument::NetworkDocument(const Xapian::Database::Internal *db_,
00030                                  Xapian::docid did_,
00031                                  const string & doc_,
00032                                  const map<Xapian::valueno, string> &values_)
00033         : Xapian::Document::Internal(db_, did_), doc(doc_), values(values_)
00034 {
00035 }
00036 
00037 string
00038 NetworkDocument::do_get_value(Xapian::valueno valueid) const
00039 {
00040     DEBUGCALL(DB, string, "NetworkDocument::get_value", valueid);
00041     map<Xapian::valueno, string>::const_iterator k = values.find(valueid);
00042     if (k == values.end()) RETURN("");
00043     RETURN(k->second);
00044 }
00045 
00046 map<Xapian::valueno, string>
00047 NetworkDocument::do_get_all_values() const
00048 {
00049     return values;
00050 }
00051 
00052 string
00053 NetworkDocument::do_get_data() const
00054 {
00055     return doc;
00056 }

Documentation for Xapian (version 1.0.10).
Generated on 24 Dec 2008 by Doxygen 1.5.2.