32 #ifndef WRAPPER_PCRE_HPP_ 33 #define WRAPPER_PCRE_HPP_ 70 explicit PCRE(pcre2_code * regExPtr) noexcept;
77 [[nodiscard]] pcre2_code *
get() noexcept;
78 [[nodiscard]]
const pcre2_code *
getc()
const noexcept;
79 [[nodiscard]]
bool valid()
const noexcept;
85 void set(pcre2_code * regExPtr);
91 void clear() noexcept;
109 pcre2_code * ptr{
nullptr};
133 inline PCRE::PCRE(pcre2_code * regExPtr) noexcept : ptr(regExPtr) {}
174 return this->ptr !=
nullptr;
198 this->ptr = regExPtr;
217 if(this->ptr !=
nullptr) {
218 pcre2_code_free(this->ptr);
253 this->ptr = pcre2_code_copy_with_tables(other.
getc());
285 this->ptr = pcre2_code_copy_with_tables(other.
getc());
334 this->ptr = other.ptr;
PCRE()=default
Default constructor.
const pcre2_code * getc() const noexcept
Gets a const pointer to the underlying regular expression.
Definition: PCRE.hpp:160
PCRE & operator=(const PCRE &other)
Copy assignment operator.
Definition: PCRE.hpp:281
RAII wrapper for Perl-compatible regular expressions.
Definition: PCRE.hpp:62
bool valid() const noexcept
Checks whether the underlying regular expression is valid.
Definition: PCRE.hpp:173
pcre2_code * get() noexcept
Gets a pointer to the underlying regular expression.
Definition: PCRE.hpp:150
virtual ~PCRE()
Destructor freeing the underlying regular expression if necessary.
Definition: PCRE.hpp:136
void set(pcre2_code *regExPtr)
Sets a PERL-compatibe regular expression.
Definition: PCRE.hpp:195
Namespace for RAII wrappers and Wrapper::Database.
Definition: Database.hpp:109
void clear() noexcept
Clears the underlying regular expression if necessary.
Definition: PCRE.hpp:216