xapian-core  1.4.22
Namespaces | Functions
serialise-error.h File Reference

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

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

Go to the source code of this file.


 The Xapian namespace contains public interfaces for the Xapian library.


std::string serialise_error (const Xapian::Error &e)
 Serialise a Xapian::Error object to a string. More...
void unserialise_error (const std::string &error_string, const std::string &prefix, const std::string &new_context)
 Unserialise a Xapian::Error object and throw it. More...

Detailed Description

functions to convert classes to strings and back

Definition in file serialise-error.h.

Function Documentation

◆ serialise_error()

std::string serialise_error ( const Xapian::Error e)

Serialise a Xapian::Error object to a string.

eThe Xapian::Error object to serialise.
Serialisation of e.

Definition at line 33 of file serialise-error.cc.

References encode_length(), Xapian::Error::get_context(), Xapian::Error::get_error_string(), Xapian::Error::get_msg(), and Xapian::Error::get_type().

Referenced by RemoteServer::RemoteServer(), RemoteServer::run(), and test_serialiseerror1().

◆ unserialise_error()

void unserialise_error ( const std::string &  error_string,
const std::string &  prefix,
const std::string &  new_context 

Unserialise a Xapian::Error object and throw it.

Note: does not return!

error_stringThe string to unserialise.
prefixOptional prefix to prepend to the unserialised Error's msg field.
new_contextOptional context to replace the context in the error. If this is specified, any existing context will be noted in the Error's msg field.

Definition at line 48 of file serialise-error.cc.

References decode_length_and_check().

Referenced by RemoteDatabase::get_message(), and test_serialiseerror1().