|
crawlserv++
[under development]
Application for crawling and analyzing textual content of websites.
|
RAII wrapper for Perl-compatible regular expressions. More...
#include <PCRE.hpp>
Construction and Destruction | |
| PCRE ()=default | |
| Default constructor. More... | |
| PCRE (pcre2_code *regExPtr) noexcept | |
| Constructor setting the underlying pointer. More... | |
| virtual | ~PCRE () |
| Destructor freeing the underlying regular expression if necessary. More... | |
Getters | |
| pcre2_code * | get () noexcept |
| Gets a pointer to the underlying regular expression. More... | |
| const pcre2_code * | getc () const noexcept |
| Gets a const pointer to the underlying regular expression. More... | |
| bool | valid () const noexcept |
| Checks whether the underlying regular expression is valid. More... | |
Setter | |
| void | set (pcre2_code *regExPtr) |
| Sets a PERL-compatibe regular expression. More... | |
Cleanup | |
| void | clear () noexcept |
| Clears the underlying regular expression if necessary. More... | |
Copy and Move | |
| PCRE (const PCRE &other) | |
| Copy constructor. More... | |
| PCRE & | operator= (const PCRE &other) |
| Copy assignment operator. More... | |
| PCRE (PCRE &&other) noexcept | |
| Move constructor. More... | |
| PCRE & | operator= (PCRE &&other) noexcept |
| Move assignment operator. More... | |
RAII wrapper for Perl-compatible regular expressions.
Sets an empty pointer on construction and clears the RegEx on destruction if necessary, avoiding memory leaks.
At the moment, this class is used exclusively by the Query::Regex class.
For more information about the PCRE library used, visit its website.
|
default |
Default constructor.
|
inlineexplicitnoexcept |
Constructor setting the underlying pointer.
| regExPtr | The address to which the underlying pointer should be set. Can either be nullptr or a valid pointer to a compiled regular expression. |
|
inlinevirtual |
Destructor freeing the underlying regular expression if necessary.
References clear().
|
inline |
Copy constructor.
Creates a copy of the underlying regular expression in the given instance, saving it in this instance.
Both pattern code points and character tables are copied.
If the other regular expression is invalid, the current instance will also be invalid.
other.| other | The regular expression to copy from. |
References getc().
|
inlinenoexcept |
Move constructor.
Moves the regular expression from the specified location into this instance of the class.
| other | The regular expression to move from. |
|
inlinenoexcept |
Clears the underlying regular expression if necessary.
The regular expression will be invalid and valid() will return false afterwards.
Referenced by operator=(), set(), and ~PCRE().
|
inlinenoexcept |
Gets a pointer to the underlying regular expression.
nullptr if none is set.
|
inlinenoexcept |
Gets a const pointer to the underlying regular expression.
nullptr if none is set. Referenced by crawlservpp::Query::RegEx::getAll(), crawlservpp::Query::RegEx::getBool(), crawlservpp::Query::RegEx::getFirst(), operator=(), and PCRE().
Copy assignment operator.
Clears the existing regular expression if necessary and creates a copy of the underlying regular expression in the given instance, saving it in this instance.
other.| other | The regular expression to copy from. |
*this). Move assignment operator.
Moves the regular expression from the specified location into this instance of the class.
| other | The regular expression to move from. |
*this).References clear().
|
inline |
Sets a PERL-compatibe regular expression.
If another expression is already managed by the class, it will be cleared.
| regExPtr | A pointer to the new regular expression to be stored or nullptr to just clear the old expression if necessary. |
References clear().
Referenced by crawlservpp::Query::RegEx::RegEx().
|
inlinenoexcept |
Checks whether the underlying regular expression is valid.
Referenced by crawlservpp::Query::RegEx::getAll(), crawlservpp::Query::RegEx::getBool(), crawlservpp::Query::RegEx::getFirst(), crawlservpp::Query::RegEx::RegEx(), and crawlservpp::Query::RegEx::valid().