00001
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #include <config.h>
00024
00025 #include "const_database_wrapper.h"
00026
00027 #include "xapian/error.h"
00028
00029 void
00030 ConstDatabaseWrapper::nonconst_access() const
00031 {
00032 throw Xapian::UnimplementedError("Access to non-const method of database "
00033 "not supported in this context");
00034 }
00035
00036 ConstDatabaseWrapper::ConstDatabaseWrapper(
00037 Xapian::Internal::RefCntPtr<const Xapian::Database::Internal> realdb_)
00038 : realdb(realdb_)
00039 {
00040 }
00041
00042 Xapian::doccount
00043 ConstDatabaseWrapper::get_doccount() const
00044 {
00045 return realdb->get_doccount();
00046 }
00047
00048 Xapian::docid
00049 ConstDatabaseWrapper::get_lastdocid() const
00050 {
00051 return realdb->get_lastdocid();
00052 }
00053
00054 totlen_t
00055 ConstDatabaseWrapper::get_total_length() const
00056 {
00057 return realdb->get_total_length();
00058 }
00059
00060 Xapian::doclength
00061 ConstDatabaseWrapper::get_avlength() const
00062 {
00063 return realdb->get_avlength();
00064 }
00065
00066 Xapian::termcount
00067 ConstDatabaseWrapper::get_doclength(Xapian::docid did) const
00068 {
00069 return realdb->get_doclength(did);
00070 }
00071
00072 Xapian::doccount
00073 ConstDatabaseWrapper::get_termfreq(const string & tname) const
00074 {
00075 return realdb->get_termfreq(tname);
00076 }
00077
00078 Xapian::termcount
00079 ConstDatabaseWrapper::get_collection_freq(const string & tname) const
00080 {
00081 return realdb->get_collection_freq(tname);
00082 }
00083
00084 Xapian::doccount
00085 ConstDatabaseWrapper::get_value_freq(Xapian::valueno slot) const
00086 {
00087 return realdb->get_value_freq(slot);
00088 }
00089
00090 std::string
00091 ConstDatabaseWrapper::get_value_lower_bound(Xapian::valueno slot) const
00092 {
00093 return realdb->get_value_lower_bound(slot);
00094 }
00095
00096 std::string
00097 ConstDatabaseWrapper::get_value_upper_bound(Xapian::valueno slot) const
00098 {
00099 return realdb->get_value_upper_bound(slot);
00100 }
00101
00102 bool
00103 ConstDatabaseWrapper::term_exists(const string & tname) const
00104 {
00105 return realdb->term_exists(tname);
00106 }
00107
00108 bool
00109 ConstDatabaseWrapper::has_positions() const
00110 {
00111 return realdb->has_positions();
00112 }
00113
00114 LeafPostList *
00115 ConstDatabaseWrapper::open_post_list(const string & tname) const
00116 {
00117 return realdb->open_post_list(tname);
00118 }
00119
00120 ValueList *
00121 ConstDatabaseWrapper::open_value_list(Xapian::valueno slot) const
00122 {
00123 return realdb->open_value_list(slot);
00124 }
00125
00126 TermList *
00127 ConstDatabaseWrapper::open_term_list(Xapian::docid did) const
00128 {
00129 return realdb->open_term_list(did);
00130 }
00131
00132 TermList *
00133 ConstDatabaseWrapper::open_allterms(const string & prefix) const
00134 {
00135 return realdb->open_allterms(prefix);
00136 }
00137
00138 PositionList *
00139 ConstDatabaseWrapper::open_position_list(Xapian::docid did,
00140 const string & tname) const
00141 {
00142 return realdb->open_position_list(did, tname);
00143 }
00144
00145 Xapian::Document::Internal *
00146 ConstDatabaseWrapper::open_document(Xapian::docid did, bool lazy) const
00147 {
00148 return realdb->open_document(did, lazy);
00149 }
00150
00151 TermList *
00152 ConstDatabaseWrapper::open_spelling_termlist(const string & word) const
00153 {
00154 return realdb->open_spelling_termlist(word);
00155 }
00156
00157 TermList *
00158 ConstDatabaseWrapper::open_spelling_wordlist() const
00159 {
00160 return realdb->open_spelling_wordlist();
00161 }
00162
00163 Xapian::doccount
00164 ConstDatabaseWrapper::get_spelling_frequency(const string & word) const
00165 {
00166 return realdb->get_spelling_frequency(word);
00167 }
00168
00169 TermList *
00170 ConstDatabaseWrapper::open_synonym_termlist(const string & term) const
00171 {
00172 return realdb->open_synonym_termlist(term);
00173 }
00174
00175 TermList *
00176 ConstDatabaseWrapper::open_synonym_keylist(const string & prefix) const
00177 {
00178 return realdb->open_synonym_keylist(prefix);
00179 }
00180
00181 string
00182 ConstDatabaseWrapper::get_metadata(const string & key) const
00183 {
00184 return realdb->get_metadata(key);
00185 }
00186
00187 TermList *
00188 ConstDatabaseWrapper::open_metadata_keylist(const std::string &prefix) const
00189 {
00190 return realdb->open_metadata_keylist(prefix);
00191 }
00192
00193 void
00194 ConstDatabaseWrapper::request_document(Xapian::docid did) const
00195 {
00196 return realdb->request_document(did);
00197 }
00198
00199 Xapian::Document::Internal *
00200 ConstDatabaseWrapper::collect_document(Xapian::docid did) const
00201 {
00202 return realdb->collect_document(did);
00203 }
00204
00205 string
00206 ConstDatabaseWrapper::get_revision_info() const
00207 {
00208 return realdb->get_revision_info();
00209 }
00210
00211 string
00212 ConstDatabaseWrapper::get_uuid() const
00213 {
00214 return realdb->get_uuid();
00215 }
00216
00217 void
00218 ConstDatabaseWrapper::invalidate_doc_object(Xapian::Document::Internal * obj) const
00219 {
00220 return realdb->invalidate_doc_object(obj);
00221 }
00222
00223
00224 void
00225 ConstDatabaseWrapper::add_spelling(const string &, Xapian::termcount) const
00226 {
00227 nonconst_access();
00228 }
00229
00230 void
00231 ConstDatabaseWrapper::remove_spelling(const string &, Xapian::termcount) const
00232 {
00233 nonconst_access();
00234 }
00235
00236 void
00237 ConstDatabaseWrapper::add_synonym(const string &, const string &) const
00238 {
00239 nonconst_access();
00240 }
00241
00242 void
00243 ConstDatabaseWrapper::remove_synonym(const string &, const string &) const
00244 {
00245 nonconst_access();
00246 }
00247
00248 void
00249 ConstDatabaseWrapper::clear_synonyms(const string &) const
00250 {
00251 nonconst_access();
00252 }
00253
00254 void
00255 ConstDatabaseWrapper::set_metadata(const string &, const string &)
00256 {
00257 nonconst_access();
00258 }
00259
00260 void
00261 ConstDatabaseWrapper::reopen()
00262 {
00263 nonconst_access();
00264 }
00265
00266 void
00267 ConstDatabaseWrapper::close()
00268 {
00269 nonconst_access();
00270 }
00271
00272 void
00273 ConstDatabaseWrapper::commit()
00274 {
00275 nonconst_access();
00276 }
00277
00278 void
00279 ConstDatabaseWrapper::cancel()
00280 {
00281 nonconst_access();
00282 }
00283
00284 void
00285 ConstDatabaseWrapper::begin_transaction(bool)
00286 {
00287 nonconst_access();
00288 }
00289
00290 void
00291 ConstDatabaseWrapper::commit_transaction()
00292 {
00293 nonconst_access();
00294 }
00295
00296 void
00297 ConstDatabaseWrapper::cancel_transaction()
00298 {
00299 nonconst_access();
00300 }
00301
00302 Xapian::docid
00303 ConstDatabaseWrapper::add_document(const Xapian::Document &)
00304 {
00305 nonconst_access();
00306 return 0;
00307 }
00308
00309 void
00310 ConstDatabaseWrapper::delete_document(Xapian::docid)
00311 {
00312 nonconst_access();
00313 }
00314
00315 void
00316 ConstDatabaseWrapper::delete_document(const string &)
00317 {
00318 nonconst_access();
00319 }
00320
00321 void
00322 ConstDatabaseWrapper::replace_document(Xapian::docid, const Xapian::Document &)
00323 {
00324 nonconst_access();
00325 }
00326
00327 Xapian::docid
00328 ConstDatabaseWrapper::replace_document(const string &,
00329 const Xapian::Document &)
00330 {
00331 nonconst_access();
00332 return 0;
00333 }
00334
00335 void
00336 ConstDatabaseWrapper::write_changesets_to_fd(int, const std::string &, bool,
00337 Xapian::ReplicationInfo *)
00338 {
00339 nonconst_access();
00340 }
00341
00342 RemoteDatabase *
00343 ConstDatabaseWrapper::as_remotedatabase()
00344 {
00345 nonconst_access();
00346 return NULL;
00347 }