| 23 | constexpr Str::size_type kErrorMessageMaxLength = 1000; |
| 24 | |
| 25 | Str errorCodeToMessage(const int errorCode) { |
| 26 | Str errorMessage(kErrorMessageMaxLength, '\0'); |
| 27 | |
| 28 | static_assert(sizeof(Str::value_type) == sizeof(PCRE2_UCHAR8), "PCRE2 char type size mismatch"); |
| 29 | |
| 30 | const auto errorMessageLength = pcre2_get_error_message( |
| 31 | // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) |
| 32 | errorCode, reinterpret_cast<PCRE2_UCHAR8*>(errorMessage.data()), errorMessage.size()); |
| 33 | errorMessage.resize(static_cast<Str::size_type>(errorMessageLength)); |
| 34 | return errorMessage; |
| 35 | } |
| 36 | } // namespace |
| 37 | |
| 38 | Regex::Regex(const std::string_view pattern) { |
no outgoing calls
no test coverage detected