aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/regex/pcre/traits.h
diff options
context:
space:
mode:
authorDmitry Potapov <potapov.d@gmail.com>2022-02-10 16:46:39 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:39 +0300
commit536101ea75c9ff5df10d01c2f460b1f6e12311b3 (patch)
tree115291277ad61b2cdcf5044d210fb103b5e1647e /library/cpp/regex/pcre/traits.h
parent5036b5f2122001f9aef8a0e4cd85440d73ea6b9f (diff)
downloadydb-536101ea75c9ff5df10d01c2f460b1f6e12311b3.tar.gz
Restoring authorship annotation for Dmitry Potapov <potapov.d@gmail.com>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/regex/pcre/traits.h')
-rw-r--r--library/cpp/regex/pcre/traits.h198
1 files changed, 99 insertions, 99 deletions
diff --git a/library/cpp/regex/pcre/traits.h b/library/cpp/regex/pcre/traits.h
index e926bdd758..c117ffbd50 100644
--- a/library/cpp/regex/pcre/traits.h
+++ b/library/cpp/regex/pcre/traits.h
@@ -1,99 +1,99 @@
-#pragma once
-
-#include <contrib/libs/pcre/pcre.h>
-
-#include <util/generic/ptr.h> // THolder
-#include <util/system/types.h> // wchar16, wchar32
-
-namespace NPcre {
- template <class TCharType>
- struct TPcreTraits;
-
- template <>
- struct TPcreTraits<char> {
- using TCharType = char;
- using TStringType = const char*;
- using TCodeType = pcre;
- using TExtraType = pcre_extra;
- static constexpr TCodeType* (*Compile)(TStringType pattern, int options, int* errcodeptr, const char** errptr, int* erroffset, const unsigned char* tableptr) = pcre_compile2;
- static constexpr TExtraType* (*Study)(const TCodeType* pattern, int options, const char** errptr) = pcre_study;
- static constexpr int (*Exec)(const TCodeType* code, const TExtraType* extra, TStringType str, int length, int startoffset, int options, int* ovector, int ovecsize) = pcre_exec;
- };
-
- template <>
- struct TPcreTraits<wchar16> {
- using TCharType = wchar16;
- using TStringType = PCRE_SPTR16;
- using TCodeType = pcre16;
- using TExtraType = pcre16_extra;
- static constexpr TCodeType* (*Compile)(TStringType pattern, int options, int* errcodeptr, const char** errptr, int* erroffset, const unsigned char* tableptr) = pcre16_compile2;
- static constexpr TExtraType* (*Study)(const TCodeType* pattern, int options, const char** errptr) = pcre16_study;
- static constexpr int (*Exec)(const TCodeType* code, const TExtraType* extra, TStringType str, int length, int startoffset, int options, int* ovector, int ovecsize) = pcre16_exec;
- };
-
- template <>
- struct TPcreTraits<wchar32> {
- using TCharType = wchar32;
- using TStringType = PCRE_SPTR32;
- using TCodeType = pcre32;
- using TExtraType = pcre32_extra;
- static constexpr TCodeType* (*Compile)(TStringType pattern, int options, int* errcodeptr, const char** errptr, int* erroffset, const unsigned char* tableptr) = pcre32_compile2;
- static constexpr TExtraType* (*Study)(const TCodeType* pattern, int options, const char** errptr) = pcre32_study;
- static constexpr int (*Exec)(const TCodeType* code, const TExtraType* extra, TStringType str, int length, int startoffset, int options, int* ovector, int ovecsize) = pcre32_exec;
- };
-
- template <class TCharType>
- struct TFreePcre;
-
- template <>
- struct TFreePcre<char> {
- static inline void Destroy(void* ptr) noexcept {
- pcre_free(ptr);
- }
- };
-
- template <>
- struct TFreePcre<wchar16> {
- static inline void Destroy(void* ptr) noexcept {
- pcre16_free(ptr);
- }
- };
-
- template <>
- struct TFreePcre<wchar32> {
- static inline void Destroy(void* ptr) noexcept {
- pcre32_free(ptr);
- }
- };
-
- template <class TCharType>
- struct TFreePcreExtra;
-
- template <>
- struct TFreePcreExtra<char> {
- static inline void Destroy(pcre_extra* ptr) noexcept {
- pcre_free_study(ptr);
- }
- };
-
- template <>
- struct TFreePcreExtra<wchar16> {
- static inline void Destroy(pcre16_extra* ptr) noexcept {
- pcre16_free_study(ptr);
- }
- };
-
- template <>
- struct TFreePcreExtra<wchar32> {
- static inline void Destroy(pcre32_extra* ptr) noexcept {
- pcre32_free_study(ptr);
- }
- };
-
- template <typename TCharType>
- using TPcreCode = THolder<typename TPcreTraits<TCharType>::TCodeType, TFreePcre<TCharType>>;
-
- template <typename TCharType>
- using TPcreExtra = THolder<typename TPcreTraits<TCharType>::TExtraType, TFreePcreExtra<TCharType>>;
-}
-
+#pragma once
+
+#include <contrib/libs/pcre/pcre.h>
+
+#include <util/generic/ptr.h> // THolder
+#include <util/system/types.h> // wchar16, wchar32
+
+namespace NPcre {
+ template <class TCharType>
+ struct TPcreTraits;
+
+ template <>
+ struct TPcreTraits<char> {
+ using TCharType = char;
+ using TStringType = const char*;
+ using TCodeType = pcre;
+ using TExtraType = pcre_extra;
+ static constexpr TCodeType* (*Compile)(TStringType pattern, int options, int* errcodeptr, const char** errptr, int* erroffset, const unsigned char* tableptr) = pcre_compile2;
+ static constexpr TExtraType* (*Study)(const TCodeType* pattern, int options, const char** errptr) = pcre_study;
+ static constexpr int (*Exec)(const TCodeType* code, const TExtraType* extra, TStringType str, int length, int startoffset, int options, int* ovector, int ovecsize) = pcre_exec;
+ };
+
+ template <>
+ struct TPcreTraits<wchar16> {
+ using TCharType = wchar16;
+ using TStringType = PCRE_SPTR16;
+ using TCodeType = pcre16;
+ using TExtraType = pcre16_extra;
+ static constexpr TCodeType* (*Compile)(TStringType pattern, int options, int* errcodeptr, const char** errptr, int* erroffset, const unsigned char* tableptr) = pcre16_compile2;
+ static constexpr TExtraType* (*Study)(const TCodeType* pattern, int options, const char** errptr) = pcre16_study;
+ static constexpr int (*Exec)(const TCodeType* code, const TExtraType* extra, TStringType str, int length, int startoffset, int options, int* ovector, int ovecsize) = pcre16_exec;
+ };
+
+ template <>
+ struct TPcreTraits<wchar32> {
+ using TCharType = wchar32;
+ using TStringType = PCRE_SPTR32;
+ using TCodeType = pcre32;
+ using TExtraType = pcre32_extra;
+ static constexpr TCodeType* (*Compile)(TStringType pattern, int options, int* errcodeptr, const char** errptr, int* erroffset, const unsigned char* tableptr) = pcre32_compile2;
+ static constexpr TExtraType* (*Study)(const TCodeType* pattern, int options, const char** errptr) = pcre32_study;
+ static constexpr int (*Exec)(const TCodeType* code, const TExtraType* extra, TStringType str, int length, int startoffset, int options, int* ovector, int ovecsize) = pcre32_exec;
+ };
+
+ template <class TCharType>
+ struct TFreePcre;
+
+ template <>
+ struct TFreePcre<char> {
+ static inline void Destroy(void* ptr) noexcept {
+ pcre_free(ptr);
+ }
+ };
+
+ template <>
+ struct TFreePcre<wchar16> {
+ static inline void Destroy(void* ptr) noexcept {
+ pcre16_free(ptr);
+ }
+ };
+
+ template <>
+ struct TFreePcre<wchar32> {
+ static inline void Destroy(void* ptr) noexcept {
+ pcre32_free(ptr);
+ }
+ };
+
+ template <class TCharType>
+ struct TFreePcreExtra;
+
+ template <>
+ struct TFreePcreExtra<char> {
+ static inline void Destroy(pcre_extra* ptr) noexcept {
+ pcre_free_study(ptr);
+ }
+ };
+
+ template <>
+ struct TFreePcreExtra<wchar16> {
+ static inline void Destroy(pcre16_extra* ptr) noexcept {
+ pcre16_free_study(ptr);
+ }
+ };
+
+ template <>
+ struct TFreePcreExtra<wchar32> {
+ static inline void Destroy(pcre32_extra* ptr) noexcept {
+ pcre32_free_study(ptr);
+ }
+ };
+
+ template <typename TCharType>
+ using TPcreCode = THolder<typename TPcreTraits<TCharType>::TCodeType, TFreePcre<TCharType>>;
+
+ template <typename TCharType>
+ using TPcreExtra = THolder<typename TPcreTraits<TCharType>::TExtraType, TFreePcreExtra<TCharType>>;
+}
+