errorhandler.hxx
#ifndef PQXX_H_ERRORHANDLER
#define PQXX_H_ERRORHANDLER
#include "pqxx/compiler-public.hxx"
#include "pqxx/compiler-internal-pre.hxx"
#include "pqxx/types.hxx"
namespace pqxx
{
namespace internal
{
namespace gate
{
class errorhandler_connection_base;
}
}
class PQXX_LIBEXPORT errorhandler
{
public:
explicit errorhandler(connection_base &);
virtual ~errorhandler();
virtual bool operator()(const char msg[]) noexcept =0;
private:
connection_base *m_home;
friend class internal::gate::errorhandler_connection_base;
void unregister() noexcept;
errorhandler() =delete;
errorhandler(const errorhandler &) =delete;
errorhandler &operator=(const errorhandler &) =delete;
};
class quiet_errorhandler : public errorhandler
{
public:
quiet_errorhandler(connection_base &conn) : errorhandler{conn} {}
virtual bool operator()(const char[]) noexcept override { return false; }
};
} // namespace pqxx
#include "pqxx/compiler-internal-post.hxx"
#endif
pqxx::quiet_errorhandler
An error handler that suppresses any previously registered error handlers.
Definition: errorhandler.hxx:80
pqxx::quiet_errorhandler::quiet_errorhandler
quiet_errorhandler(connection_base &conn)
Definition: errorhandler.hxx:83
pqxx::internal
Private namespace for libpqxx's internal use; do not access.
Definition: connection_base.hxx:43
pqxx::internal::name_encoding
const char * name_encoding(int encoding_id)
Definition: encodings.cxx:631
pqxx::internal::enc_group
encoding_group enc_group(int libpq_enc_id)
Definition: encodings.cxx:637
pqxx::errorhandler
Base class for error-handler callbacks.
Definition: errorhandler.hxx:54
pqxx::quiet_errorhandler::operator()
virtual bool operator()(const char[]) noexcept override
Define in subclass: receive an error or warning message from the database.
Definition: errorhandler.hxx:85
pqxx::internal::get_glyph_scanner
glyph_scanner_func * get_glyph_scanner(encoding_group enc)
Definition: encodings.cxx:738
pqxx::argument_error
Invalid argument passed to libpqxx, similar to std::invalid_argument.
Definition: except.hxx:229
pqxx::errorhandler::~errorhandler
virtual ~errorhandler()
Definition: errorhandler.cxx:30
pqxx::to_string
std::string to_string(const field &Obj)
Convert a field to a string.
Definition: result.cxx:451
pqxx::connection_base
connection_base abstract base class; represents a connection to a database.
Definition: connection_base.hxx:139
pqxx::internal::find_with_encoding
std::string::size_type find_with_encoding(encoding_group enc, const std::string &haystack, char needle, std::string::size_type start)
Definition: encodings.cxx:790
pqxx::internal::for_encoding
F * for_encoding(encoding_group enc)
Look up instantiation T<enc>::call at runtime.
Definition: encodings.cxx:707
pqxx::errorhandler::errorhandler
errorhandler(connection_base &)
Definition: errorhandler.cxx:23
pqxx
The home of all libpqxx classes, functions, templates, etc.
Definition: array.hxx:25
pqxx::usage_error
Error in usage of libpqxx library, similar to std::logic_error.
Definition: except.hxx:218