xapian-core  2.0.0
serialise.h
Go to the documentation of this file.
1 
4 /* Copyright (C) 2006,2007,2008,2009,2012,2014,2024 Olly Betts
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, see
18  * <https://www.gnu.org/licenses/>.
19  */
20 
21 #ifndef XAPIAN_INCLUDED_SERIALISE_H
22 #define XAPIAN_INCLUDED_SERIALISE_H
23 
24 #include <string>
25 #include <string_view>
26 
27 #include "xapian/weight.h"
28 
29 // Forward class declarations:
30 
31 namespace Xapian {
32  class Document;
33  class RSet;
34 }
35 
42 std::string serialise_stats(const Xapian::Weight::Internal &stats);
43 
50 void unserialise_stats(const char* p, const char* p_end,
52 
59 std::string serialise_rset(const Xapian::RSet &omrset);
60 
67 Xapian::RSet unserialise_rset(const std::string &s);
68 
75 std::string serialise_document(const Xapian::Document &doc);
76 
83 Xapian::Document unserialise_document(std::string_view s);
84 
85 #endif
Class representing a document.
Definition: document.h:64
Class representing a set of documents judged as relevant.
Definition: rset.h:39
Class to hold statistics for a given collection.
PositionList * p
The Xapian namespace contains public interfaces for the Xapian library.
Definition: compactor.cc:82
std::string serialise_rset(const Xapian::RSet &omrset)
Serialise a Xapian::RSet object.
Definition: serialise.cc:148
void unserialise_stats(const char *p, const char *p_end, Xapian::Weight::Internal &stats)
Unserialise a serialised stats object.
Definition: serialise.cc:92
std::string serialise_document(const Xapian::Document &doc)
Serialise a Xapian::Document object.
Definition: serialise.cc:183
std::string serialise_stats(const Xapian::Weight::Internal &stats)
Serialise a stats object.
Definition: serialise.cc:42
Xapian::RSet unserialise_rset(const std::string &s)
Unserialise a serialised Xapian::RSet object.
Definition: serialise.cc:162
Xapian::Document unserialise_document(std::string_view s)
Unserialise a serialised Xapian::Document object.
Definition: serialise.cc:223
Weighting scheme API.