xapian-core  1.4.26
Namespaces | Functions
serialise.h File Reference

functions to convert classes to strings and back More...

#include <string>
#include "xapian/weight.h"
+ Include dependency graph for serialise.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 Xapian
 The Xapian namespace contains public interfaces for the Xapian library.
 

Functions

std::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 &stats)
 Unserialise a serialised stats object. More...
 
std::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...
 
std::string serialise_rset (const Xapian::RSet &omrset)
 Serialise a Xapian::RSet object. More...
 
Xapian::RSet unserialise_rset (const std::string &s)
 Unserialise a serialised Xapian::RSet object. More...
 
std::string serialise_document (const Xapian::Document &doc)
 Serialise a Xapian::Document object. More...
 
Xapian::Document unserialise_document (const std::string &s)
 Unserialise a serialised Xapian::Document object. More...
 

Detailed Description

functions to convert classes to strings and back

Definition in file serialise.h.

Function Documentation

◆ serialise_document()

std::string serialise_document ( const Xapian::Document doc)

◆ serialise_mset()

std::string serialise_mset ( const Xapian::MSet mset)

◆ serialise_rset()

std::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()

std::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().