libpqxx
The C++ client library for PostgreSQL
encoding_group.hxx
1 
9 #ifndef PQXX_H_ENCODING_GROUP
10 #define PQXX_H_ENCODING_GROUP
11 
12 #include <cstddef>
13 
14 namespace pqxx::internal
15 {
16 // Types of encodings supported by PostgreSQL, see
17 // https://www.postgresql.org/docs/current/static/multibyte.html#CHARSET-TABLE
18 enum class encoding_group
19 {
20  // Handles all single-byte fixed-width encodings
21  MONOBYTE,
22 
23  // Multibyte encodings.
24  // Many of these can embed ASCII-like bytes inside multibyte characters,
25  // notably Big5, SJIS, SHIFT_JIS_2004, GP18030, GBK, JOHAB, UHC.
26  BIG5,
27  EUC_CN,
28  EUC_JP,
29  EUC_KR,
30  EUC_TW,
31  GB18030,
32  GBK,
33  JOHAB,
34  MULE_INTERNAL,
35  SJIS,
36  UHC,
37  UTF8,
38 };
39 
40 
41 // TODO: Get rid of these. Specialise at higher level.
43 
52 using glyph_scanner_func =
53  std::size_t(char const buffer[], std::size_t buffer_len, std::size_t start);
54 
55 
57 
70 using char_finder_func =
71  std::size_t(std::string_view haystack, std::size_t start);
72 } // namespace pqxx::internal
73 
74 #endif
Internal items for libpqxx' own use. Do not use these yourself.
Definition: encodings.cxx:32
std::size_t(char const buffer[], std::size_t buffer_len, std::size_t start) glyph_scanner_func
Function type: "find the end of the current glyph.".
Definition: encoding_group.hxx:53
std::size_t(std::string_view haystack, std::size_t start) char_finder_func
Function type: "find first occurrence of specific any of ASCII characters.".
Definition: encoding_group.hxx:71