pqxx::internal Namespace Reference
String conversion

Private namespace for libpqxx's internal use; do not access. More...

## Namespaces

| gate

## Classes

struct | deref_ptr
struct | dereference
| Functor: dereference iterator. More...
class | Escaper
class | namedclass
class | notify_listener_forwarder
| Internal helper class to support old-style, payloadless notifications. More...
class | parameterized_invocation
class | PQAlloc
| Reference-counted smart pointer to libpq-allocated object. More...
class | reactivation_avoidance_counter
class | reactivation_avoidance_exemption
| Scoped exemption to reactivation avoidance. More...
class | refcount
class | scoped_array
class | sql_cursor
| Cursor with SQL positioning semantics. More...
class | transactionfocus
class | unique
| Ensure proper opening/closing of GUEST objects related to a "host" object. More...

## Typedefs

typedef unsigned long | result_size_type
typedef long | result_difference_type
typedef const char * | cstring
| Work around problem with library export directives and pointers. More...

## Functions

void | wait_read (const internal::pq::PGconn *)
void | wait_read (const internal::pq::PGconn *, long seconds, long microseconds)
void | wait_write (const internal::pq::PGconn *)
result::size_type | obtain_stateless_cursor_size (sql_cursor &)
result | stateless_cursor_retrieve (sql_cursor &, result::difference_type size, result::difference_type begin_pos, result::difference_type end_pos)
void PQXX_NORETURN | throw_null_conversion (const std::string &type)
| Throw exception for attempt to convert null to given type. More...
int | digit_to_number (char c) throw ()
| Compute numeric value of given textual digit (assuming that it is a digit) More...
char | number_to_digit (int i) throw ()
std::string | Escape (const std::string &s, const std::string &null)
std::string | EscapeAny (const std::string &s, const std::string &null)
std::string | EscapeAny (const char s[], const std::string &null)
template<typename T >
std::string | EscapeAny (const T &t, const std::string &null)
void | freepqmem (const void *) throw ()
template<typename P >
void | freepqmem_templated (P *p) throw ()
void | freemallocmem (const void *) throw ()
template<typename P >
void | freemallocmem_templated (P *p) throw ()
void | CheckUniqueRegistration (const namedclass *New, const namedclass *Old)
void | CheckUniqueUnregistration (const namedclass *New, const namedclass *Old)
void | sleep_seconds (int)
| Sleep for the given number of seconds. More...
cstring | strerror_wrapper (int err, char buf[], std::size_t len) throw ()
| Human-readable description for error code, possibly using given buffer. More...
template<typename T >
std::ptrdiff_t | distance (T first, T last)
| Wrapper for std::distance; not all platforms have std::distance(). More...

## Variables

const char | sql_begin_work [] = "BEGIN"
| Commonly used SQL commands. More...
const char | sql_commit_work [] = "COMMIT"
const char | sql_rollback_work [] = "ROLLBACK"

## Detailed Description

Private namespace for libpqxx's internal use; do not access.

This namespace hides definitions internal to libpqxx. These are not supposed to be used by client programs, and they may change at any time without notice.

Conversely, if you find something in this namespace tremendously useful, by all means do lodge a request for its publication.

Warning
  Here be dragons!

## Typedef Documentation

## cstring

typedef const char* pqxx::internal::cstring

Work around problem with library export directives and pointers.

## result_difference_type

typedef long pqxx::internal::result_difference_type

## result_size_type

typedef unsigned long pqxx::internal::result_size_type

## Function Documentation

## CheckUniqueRegistration()

void pqxx::internal::CheckUniqueRegistration | ( | const namedclass * | New,
|  | const namedclass * | Old
| ) |  |

References pqxx::internal::namedclass::description().

Referenced by pqxx::internal::namedclass::classname().

## CheckUniqueUnregistration()

void pqxx::internal::CheckUniqueUnregistration | ( | const namedclass * | New,
|  | const namedclass * | Old
| ) |  |

References pqxx::internal::namedclass::description().

Referenced by pqxx::internal::namedclass::classname().

## digit_to_number()

int pqxx::internal::digit_to_number | ( | char | c | ) |
throw | ( |
| ) |  |

Compute numeric value of given textual digit (assuming that it is a digit)

References digit_to_number().

Referenced by pqxx::tablereader::complete(), and digit_to_number().

## distance()

template<typename T >

std::ptrdiff_t pqxx::internal::distance | ( | T | first,
|  | T | last
| ) |  |

Wrapper for std::distance; not all platforms have std::distance().

References distance().

Referenced by distance(), and pqxx::pipeline::resume().

## Escape()

string pqxx::internal::Escape | ( | const std::string & | s,
|  | const std::string & | null
| ) |  |

## EscapeAny() [1/3]

std::string pqxx::internal::EscapeAny | ( | const std::string & | s,
|  | const std::string & | null
| ) |  |

References EscapeAny().

Referenced by EscapeAny(), and pqxx::internal::Escaper< IT >::operator()().

## EscapeAny() [2/3]

std::string pqxx::internal::EscapeAny | ( | const char | s[],
|  | const std::string & | null
| ) |  |

References EscapeAny().

## EscapeAny() [3/3]

template<typename T >

std::string pqxx::internal::EscapeAny | ( | const T & | t,
|  | const std::string & | null
| ) |  |

References EscapeAny(), and pqxx::to_string().

## freemallocmem()

void pqxx::internal::freemallocmem | ( | const void * | p | ) |
throw | ( |
| ) |  |

Referenced by freemallocmem_templated(), and freepqmem_templated().

## freemallocmem_templated()

template<typename P >

void pqxx::internal::freemallocmem_templated | ( | P * | p | ) |
throw | ( |
| ) |  |

References freemallocmem(), freemallocmem_templated(), and pqxx::internal::PQAlloc< T, DELETER >::get().

Referenced by freemallocmem_templated().

## freepqmem()

void pqxx::internal::freepqmem | ( | const void * | p | ) |
throw | ( |
| ) |  |

Referenced by freepqmem_templated().

## freepqmem_templated()

template<typename P >

void pqxx::internal::freepqmem_templated | ( | P * | p | ) |
throw | ( |
| ) |  |

References freemallocmem(), freepqmem(), and freepqmem_templated().

Referenced by freepqmem_templated().

## number_to_digit()

char pqxx::internal::number_to_digit | ( | int | i | ) |
throw | ( |
| ) |  |

References number_to_digit().

Referenced by pqxx::tablewriter::complete(), and number_to_digit().

## obtain_stateless_cursor_size()

result::size_type pqxx::internal::obtain_stateless_cursor_size | ( | sql_cursor & | cur | ) |

References pqxx::cursor_base::all(), pqxx::internal::sql_cursor::endpos(), and pqxx::internal::sql_cursor::move().

Referenced by pqxx::internal::sql_cursor::empty_result(), and pqxx::stateless_cursor< up, op >::size().

## sleep_seconds()

void pqxx::internal::sleep_seconds | ( | int | s | ) |

Sleep for the given number of seconds.

May return early, e.g. when interrupted by a signal. Completes instantly if a zero or negative sleep time is requested.

References pqxx::to_string().

Referenced by pqxx::internal::unique< pqxx::transaction_base >::Unregister(), and pqxx::basic_robusttransaction::~basic_robusttransaction().

## stateless_cursor_retrieve()

result pqxx::internal::stateless_cursor_retrieve | ( | sql_cursor & | cur,
|  | result::difference_type | size,
|  | result::difference_type | begin_pos,
|  | result::difference_type | end_pos
| ) |  |

References pqxx::internal::sql_cursor::empty_result(), pqxx::internal::sql_cursor::fetch(), pqxx::internal::sql_cursor::move(), and pqxx::internal::sql_cursor::pos().

Referenced by pqxx::internal::sql_cursor::empty_result(), and pqxx::stateless_cursor< up, op >::retrieve().

## strerror_wrapper()

cstring pqxx::internal::strerror_wrapper | ( | int | err,
|  | char | buf[],
|  | std::size_t | len
| ) |  |
throw | ( |
| ) |  |

Human-readable description for error code, possibly using given buffer.

Wrapper for `strerror()` or thread-safe variant, as available. The default code copies the string to the provided buffer, but this may not always be necessary. The result is guaranteed to remain usable for as long as the given buffer does.

Parameters

  err | system error code as copied from errno
  buf | caller-provided buffer for message to be stored in, if needed
  len | usable size (in bytes) of provided buffer

Returns
  human-readable error string, which may or may not reside in buf

Referenced by pqxx::largeobject::Reason().

## throw_null_conversion()

void pqxx::internal::throw_null_conversion | ( | const std::string & | type | ) |

Throw exception for attempt to convert null to given type.

References pqxx::from_string(), throw_null_conversion(), and pqxx::to_string().

Referenced by pqxx::string_traits< std::string >::null(), pqxx::string_traits< const std::string >::null(), pqxx::string_traits< std::stringstream >::null(), and throw_null_conversion().

## wait_read() [1/2]

void pqxx::internal::wait_read | ( | const internal::pq::PGconn * |  | ) |

Referenced by pqxx::connection_base::await_notification(), pqxx::internal::reactivation_avoidance_exemption::close_connection(), pqxx::connect_async::do_completeconnect(), pqxx::connection_base::get_verbosity(), pqxx::connection_base::wait_read(), and pqxx::internal::reactivation_avoidance_exemption::~reactivation_avoidance_exemption().

## wait_read() [2/2]

void pqxx::internal::wait_read | ( | const internal::pq::PGconn * | ,
|  | long | seconds,
|  | long | microseconds
| ) |  |

## wait_write()

void pqxx::internal::wait_write | ( | const internal::pq::PGconn * |  | ) |

Referenced by pqxx::internal::reactivation_avoidance_exemption::close_connection(), pqxx::connect_async::do_completeconnect(), pqxx::connection_base::get_verbosity(), pqxx::connection_base::wait_write(), and pqxx::internal::reactivation_avoidance_exemption::~reactivation_avoidance_exemption().

## Variable Documentation

## sql_begin_work

const char pqxx::internal::sql_begin_work = "BEGIN"

Commonly used SQL commands.

## sql_commit_work

const char pqxx::internal::sql_commit_work = "COMMIT"

Referenced by pqxx::basic_transaction::basic_transaction(), and pqxx::basic_robusttransaction::~basic_robusttransaction().

## sql_rollback_work

const char pqxx::internal::sql_rollback_work = "ROLLBACK"

Referenced by pqxx::dbtransaction::do_abort().