xapian-core  1.4.21
Functions
serialise.cc File Reference

functions to convert Xapian objects to strings and back More...

#include <config.h>
#include <xapian/document.h>
#include <xapian/positioniterator.h>
#include <xapian/termiterator.h>
#include <xapian/valueiterator.h>
#include "omassert.h"
#include "api/omenquireinternal.h"
#include "length.h"
#include "serialise.h"
#include "serialise-double.h"
#include "weight/weightinternal.h"
#include "autoptr.h"
#include <set>
#include <string>
+ Include dependency graph for serialise.cc:

Go to the source code of this file.

Functions

string serialise_stats (const Xapian::Weight::Internal &stats)
 Serialise a stats object. More...
 
void unserialise_stats (const char *p, const char *p_end, Xapian::Weight::Internal &stat)
 Unserialise a serialised stats object. More...
 
string serialise_mset (const Xapian::MSet &mset)
 Serialise a Xapian::MSet object. More...
 
Xapian::MSet unserialise_mset (const char *p, const char *p_end)
 Unserialise a serialised Xapian::MSet object. More...
 
string serialise_rset (const Xapian::RSet &rset)
 Serialise a Xapian::RSet object. More...
 
Xapian::RSet unserialise_rset (const string &s)
 Unserialise a serialised Xapian::RSet object. More...
 
string serialise_document (const Xapian::Document &doc)
 Serialise a Xapian::Document object. More...
 
Xapian::Document unserialise_document (const string &s)
 Unserialise a serialised Xapian::Document object. More...
 

Detailed Description

functions to convert Xapian objects to strings and back

Definition in file serialise.cc.

Function Documentation

◆ serialise_document()

string serialise_document ( const Xapian::Document doc)

◆ serialise_mset()

string serialise_mset ( const Xapian::MSet mset)

◆ serialise_rset()

string serialise_rset ( const Xapian::RSet omrset)

Serialise a Xapian::RSet object.

Parameters
rsetThe object to serialise.
Returns
The serialisation of the Xapian::RSet object.

Definition at line 217 of file serialise.cc.

References encode_length(), and Xapian::RSet::internal.

Referenced by RemoteDatabase::set_query().

◆ serialise_stats()

string serialise_stats ( const Xapian::Weight::Internal stats)

◆ unserialise_document()

Xapian::Document unserialise_document ( const std::string &  s)

◆ unserialise_mset()

Xapian::MSet unserialise_mset ( const char *  p,
const char *  p_end 
)

Unserialise a serialised Xapian::MSet object.

Parameters
pPointer to the start of the string to unserialise.
p_endPointer to the end of the string to unserialise.
Returns
The unserialised Xapian::MSet object.

Definition at line 154 of file serialise.cc.

References decode_length(), decode_length_and_check(), Xapian::MSet::internal, unserialise_double(), and unserialise_stats().

Referenced by RemoteDatabase::get_mset().

◆ unserialise_rset()

Xapian::RSet unserialise_rset ( const std::string &  s)

Unserialise a serialised Xapian::RSet object.

Parameters
sThe serialised object as a string.
Returns
The unserialised Xapian::RSet object.

Definition at line 232 of file serialise.cc.

References Xapian::RSet::add_document(), decode_length(), and Xapian::RSet::size().

Referenced by RemoteServer::msg_query().

◆ unserialise_stats()

void unserialise_stats ( const char *  p,
const char *  p_end,
Xapian::Weight::Internal stats 
)

Unserialise a serialised stats object.

Parameters
pPointer to data to unserialise.
p_endEnd of data to unserialise.
statsThe stats object to unserialise to.

Definition at line 71 of file serialise.cc.

References Xapian::Weight::Internal::collection_size, decode_length(), decode_length_and_check(), dummy, Xapian::Weight::Internal::have_max_part, Xapian::Weight::Internal::rset_size, Xapian::Weight::Internal::termfreqs, Xapian::Weight::Internal::total_length, and unserialise_double().

Referenced by RemoteDatabase::get_remote_stats(), RemoteServer::msg_query(), and unserialise_mset().