16#ifndef _PCRE2CPP_PCRE2_DATA_HPP_
17 #define _PCRE2CPP_PCRE2_DATA_HPP_
21 #if !_PCRE2CPP_HAS_CXX17
32 #if _PCRE2CPP_HAS_UTF8
35 #if _PCRE2CPP_HAS_UTF16
38 #if _PCRE2CPP_HAS_UTF32
50 template<utf_type utf>
54 #if _PCRE2CPP_HAS_UTF8
63 using code_type = pcre2_code_8;
65 using compile_ctx_type = pcre2_compile_context_8;
67 using general_ctx_type = pcre2_general_context_8;
72 using match_data_type = pcre2_match_data_8;
74 using match_ctx_type = pcre2_match_context_8;
77 #pragma region PCRE2_STRING
79 using sptr_type = PCRE2_SPTR8;
81 using uchar_type = PCRE2_UCHAR8;
84 #pragma region CPP_STRING
93 using string_type = std::string;
95 using string_view_type = std::string_view;
97 using string_char_type = string_type::value_type;
100 #pragma region UTF_INFO
107 #pragma region CODE_FUNCTIONS
109 static _PCRE2CPP_CONSTEXPR17 mstd::c_func_t<code_type*(sptr_type, size_t, uint32_t,
int*,
size_t*, compile_ctx_type*)>
110 compile = pcre2_compile_8;
115 #pragma region MATCH_DATA_FUNCTIONS
118 match_data_from_pattern = pcre2_match_data_create_from_pattern_8;
120 static _PCRE2CPP_CONSTEXPR17 mstd::c_func_t<void(match_data_type*)> match_data_free = pcre2_match_data_free_8;
123 #pragma region MATCH_FUNCTIONS
126 mstd::c_func_t<int(
const code_type*, sptr_type,
size_t,
size_t, uint32_t, match_data_type*, match_ctx_type*)>
127 match = pcre2_match_8;
130 #pragma region OVECTOR_FUNCTIONS
132 static _PCRE2CPP_CONSTEXPR17 mstd::c_func_t<
size_t*(match_data_type*)> get_ovector_ptr = pcre2_get_ovector_pointer_8;
134 static _PCRE2CPP_CONSTEXPR17 mstd::c_func_t<uint32_t(match_data_type*)> get_ovector_count = pcre2_get_ovector_count_8;
137 #pragma region ERROR_FUNCTIONS
139 static _PCRE2CPP_CONSTEXPR17 mstd::c_func_t<int(
int, uchar_type*,
size_t)> get_error_message = pcre2_get_error_message_8;
142 #pragma region PATTERN_INFO_FUNCTIONS
144 static _PCRE2CPP_CONSTEXPR17 mstd::c_func_t<int(
const code_type*, uint32_t,
void*)> get_info = pcre2_pattern_info_8;
147 #pragma region SUBSTRING_FUNCTIONS
149 static _PCRE2CPP_CONSTEXPR17 mstd::c_func_t<int(
const code_type*, sptr_type)> substring_number_from_name =
150 pcre2_substring_number_from_name_8;
157 #pragma region UTF_16
159 #if _PCRE2CPP_HAS_UTF16
168 using code_type = pcre2_code_16;
170 using compile_ctx_type = pcre2_compile_context_16;
172 using general_ctx_type = pcre2_general_context_16;
177 using match_data_type = pcre2_match_data_16;
179 using match_ctx_type = pcre2_match_context_16;
182 #pragma region PCRE2_STRING
184 using sptr_type = PCRE2_SPTR16;
186 using uchar_type = PCRE2_UCHAR16;
189 #pragma region CPP_STRING
191 using string_type = std::u16string;
193 using string_view_type = std::u16string_view;
195 using string_char_type = string_type::value_type;
198 #pragma region UTF_INFO
205 #pragma region CODE_FUNCTIONS
207 static _PCRE2CPP_CONSTEXPR17 mstd::c_func_t<code_type*(sptr_type, size_t, uint32_t,
int*,
size_t*, compile_ctx_type*)>
208 compile = pcre2_compile_16;
213 #pragma region MATCH_DATA_FUNCTIONS
216 match_data_from_pattern = pcre2_match_data_create_from_pattern_16;
218 static _PCRE2CPP_CONSTEXPR17 mstd::c_func_t<void(match_data_type*)> match_data_free = pcre2_match_data_free_16;
221 #pragma region MATCH_FUNCTIONS
224 mstd::c_func_t<int(
const code_type*, sptr_type,
size_t,
size_t, uint32_t, match_data_type*, match_ctx_type*)>
225 match = pcre2_match_16;
228 #pragma region OVECTOR_FUNCTIONS
230 static _PCRE2CPP_CONSTEXPR17 mstd::c_func_t<
size_t*(match_data_type*)> get_ovector_ptr = pcre2_get_ovector_pointer_16;
232 static _PCRE2CPP_CONSTEXPR17 mstd::c_func_t<uint32_t(match_data_type*)> get_ovector_count = pcre2_get_ovector_count_16;
235 #pragma region ERROR_FUNCTIONS
237 static _PCRE2CPP_CONSTEXPR17 mstd::c_func_t<int(
int, uchar_type*,
size_t)> get_error_message = pcre2_get_error_message_16;
240 #pragma region PATTERN_INFO_FUNCTIONS
242 static _PCRE2CPP_CONSTEXPR17 mstd::c_func_t<int(
const code_type*, uint32_t,
void*)> get_info = pcre2_pattern_info_16;
245 #pragma region SUBSTRING_FUNCTIONS
247 static _PCRE2CPP_CONSTEXPR17 mstd::c_func_t<int(
const code_type*, sptr_type)> substring_number_from_name =
248 pcre2_substring_number_from_name_16;
255 #pragma region UTF_32
257 #if _PCRE2CPP_HAS_UTF32
266 using code_type = pcre2_code_32;
268 using compile_ctx_type = pcre2_compile_context_32;
270 using general_ctx_type = pcre2_general_context_32;
275 using match_data_type = pcre2_match_data_32;
277 using match_ctx_type = pcre2_match_context_32;
280 #pragma region PCRE2_STRING
282 using sptr_type = PCRE2_SPTR32;
284 using uchar_type = PCRE2_UCHAR32;
287 #pragma region CPP_STRING
289 using string_type = std::u32string;
291 using string_view_type = std::u32string_view;
293 using string_char_type = string_type::value_type;
296 #pragma region UTF_INFO
303 #pragma region CODE_FUNCTIONS
305 static _PCRE2CPP_CONSTEXPR17 mstd::c_func_t<code_type*(sptr_type, size_t, uint32_t,
int*,
size_t*, compile_ctx_type*)>
306 compile = pcre2_compile_32;
311 #pragma region MATCH_DATA_FUNCTIONS
314 match_data_from_pattern = pcre2_match_data_create_from_pattern_32;
316 static _PCRE2CPP_CONSTEXPR17 mstd::c_func_t<void(match_data_type*)> match_data_free = pcre2_match_data_free_32;
319 #pragma region MATCH_FUNCTIONS
322 mstd::c_func_t<int(
const code_type*, sptr_type,
size_t,
size_t, uint32_t, match_data_type*, match_ctx_type*)>
323 match = pcre2_match_32;
326 #pragma region OVECTOR_FUNCTIONS
328 static _PCRE2CPP_CONSTEXPR17 mstd::c_func_t<
size_t*(match_data_type*)> get_ovector_ptr = pcre2_get_ovector_pointer_32;
330 static _PCRE2CPP_CONSTEXPR17 mstd::c_func_t<uint32_t(match_data_type*)> get_ovector_count = pcre2_get_ovector_count_32;
333 #pragma region ERROR_FUNCTIONS
335 static _PCRE2CPP_CONSTEXPR17 mstd::c_func_t<int(
int, uchar_type*,
size_t)> get_error_message = pcre2_get_error_message_32;
338 #pragma region PATTERN_INFO_FUNCTIONS
340 static _PCRE2CPP_CONSTEXPR17 mstd::c_func_t<int(
const code_type*, uint32_t,
void*)> get_info = pcre2_pattern_info_32;
343 #pragma region SUBSTRING_FUNCTIONS
345 static _PCRE2CPP_CONSTEXPR17 mstd::c_func_t<int(
const code_type*, sptr_type)> substring_number_from_name =
346 pcre2_substring_number_from_name_32;
353 #if _PCRE2CPP_HAS_UTF8
356 #if _PCRE2CPP_HAS_UTF16
359 #if _PCRE2CPP_HAS_UTF32
utf_type
Enum with supported utf types.
Definition pcre2cpp.hpp:352
@ UTF_16
Definition pcre2cpp.hpp:357
@ UTF_32
Definition pcre2cpp.hpp:360
@ UTF_8
Definition pcre2cpp.hpp:354
#define _PCRE2CPP_CONSTEXPR17
constexpr for c++17 and higher
Definition config.hpp:239
#define _PCRE2CPP_ERROR(MESSAGE)
compiler error
Definition config.hpp:278
Definition pcre2cpp.hpp:310
pcre2_data< utf_type::UTF_8 > u8pcre2_data
Definition pcre2cpp.hpp:675
pcre2_data< utf_type::UTF_32 > u32pcre2_data
Definition pcre2cpp.hpp:681
pcre2_data< utf_type::UTF_16 > u16pcre2_data
Definition pcre2cpp.hpp:678
Main namespace of pcre2cpp library.
Translation container from pcre2 library to pcre2cpp.
Definition pcre2cpp.hpp:372