libpqxx
Utility functions
Collaboration diagram for Utility functions:

Namespaces

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

Functions

template<typename ITER , typename ACCESS >
std::string pqxx::separated_list (const std::string &sep, ITER begin, ITER end, ACCESS access)
 Represent sequence of values as a string, joined by a given separator. More...
 
template<typename ITER >
std::string pqxx::separated_list (const std::string &sep, ITER begin, ITER end)
 Render sequence as a string, using given separator between items. More...
 
template<typename CONTAINER >
auto pqxx::separated_list (const std::string &sep, const CONTAINER &c) -> typename std::enable_if<(not std::is_void< decltype(std::begin(c))>::value and not std::is_void< decltype(std::end(c))>::value), std::string >::type
 Render items in a container as a string, using given separator. More...
 
template<typename TUPLE , std::size_t INDEX = 0, typename ACCESS , typename std::enable_if<(INDEX==std::tuple_size< TUPLE >::value-1), int >::type = 0>
std::string pqxx::separated_list (const std::string &, const TUPLE &t, const ACCESS &access)
 Render items in a tuple as a string, using given separator. More...
 
template<typename TUPLE , std::size_t INDEX = 0, typename ACCESS >
std::string pqxx::separated_list (const std::string &sep, const TUPLE &t, const ACCESS &access)
 
template<typename TUPLE , std::size_t INDEX = 0>
std::string pqxx::separated_list (const std::string &sep, const TUPLE &t)
 

Detailed Description

Function Documentation

◆ separated_list() [1/6]

template<typename ITER , typename ACCESS >
std::string pqxx::separated_list ( const std::string &  sep,
ITER  begin,
ITER  end,
ACCESS  access 
)

Represent sequence of values as a string, joined by a given separator.

Use this to turn e.g. the numbers 1, 2, and 3 into a string "1, 2, 3".

Parameters
sepseparator string (to be placed between items)
beginbeginning of items sequence
endend of items sequence
accessfunctor defining how to dereference sequence elements

References pqxx::to_string().

Referenced by pqxx::stream_base::columnlist(), pqxx::tablestream::columnlist(), pqxx::tablewriter::generate(), pqxx::stream_to::operator<<(), pqxx::pipeline::resume(), and pqxx::separated_list().

◆ separated_list() [2/6]

template<typename ITER >
std::string pqxx::separated_list ( const std::string &  sep,
ITER  begin,
ITER  end 
)

Render sequence as a string, using given separator between items.

References pqxx::separated_list().

◆ separated_list() [3/6]

template<typename CONTAINER >
auto pqxx::separated_list ( const std::string &  sep,
const CONTAINER &  c 
) -> typename std::enable_if< ( not std::is_void<decltype(std::begin(c))>::value and not std::is_void<decltype(std::end(c))>::value ), std::string >::type

Render items in a container as a string, using given separator.

References pqxx::separated_list().

◆ separated_list() [4/6]

template<typename TUPLE , std::size_t INDEX = 0, typename ACCESS , typename std::enable_if<(INDEX==std::tuple_size< TUPLE >::value-1), int >::type = 0>
std::string pqxx::separated_list ( const std::string &  ,
const TUPLE &  t,
const ACCESS &  access 
)

Render items in a tuple as a string, using given separator.

References pqxx::to_string().

◆ separated_list() [5/6]

template<typename TUPLE , std::size_t INDEX = 0, typename ACCESS >
std::string pqxx::separated_list ( const std::string &  sep,
const TUPLE &  t,
const ACCESS &  access 
)

References pqxx::to_string().

◆ separated_list() [6/6]

template<typename TUPLE , std::size_t INDEX = 0>
std::string pqxx::separated_list ( const std::string &  sep,
const TUPLE &  t 
)