Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qregularexpression.cpp File Reference

(d7007090bbc1840f873fd4173de8542cb62206d0)

#include "qregularexpression.h"
#include <QtCore/qcoreapplication.h>
#include <QtCore/qhashfunctions.h>
#include <QtCore/qlist.h>
#include <QtCore/qmutex.h>
#include <QtCore/qstringlist.h>
#include <QtCore/qdebug.h>
#include <QtCore/qglobal.h>
#include <QtCore/qatomic.h>
#include <QtCore/qdatastream.h>
#include <pcre2.h>
+ Include dependency graph for qregularexpression.cpp:

Go to the source code of this file.

Classes

struct  QRegularExpressionPrivate
 
struct  QRegularExpressionMatchPrivate
 
struct  QRegularExpressionMatchIteratorPrivate
 

Macros

#define PCRE2_CODE_UNIT_WIDTH   16
 

Functions

static int convertToPcreOptions (QRegularExpression::PatternOptions patternOptions)
 
static int convertToPcreOptions (QRegularExpression::MatchOptions matchOptions)
 
Q_DECL_COLD_FUNCTION void qtWarnAboutInvalidRegularExpression (const QString &pattern, const char *where)
 
static pcre2_jit_stack_16 * qtPcreCallback (void *)
 
static bool isJitEnabled ()
 
static int safe_pcre2_match_16 (const pcre2_code_16 *code, PCRE2_SPTR16 subject, qsizetype length, qsizetype startOffset, int options, pcre2_match_data_16 *matchData, pcre2_match_context_16 *matchContext)
 
bool comparesEqual (const QRegularExpression &lhs, const QRegularExpression &rhs)
 
QtPrivate::QRegularExpressionMatchIteratorRangeBasedForIterator begin (const QRegularExpressionMatchIterator &iterator)
 

Macro Definition Documentation

◆ PCRE2_CODE_UNIT_WIDTH

#define PCRE2_CODE_UNIT_WIDTH   16

Definition at line 22 of file qregularexpression.cpp.

Function Documentation

◆ begin()

◆ comparesEqual()

bool comparesEqual ( const QRegularExpression & lhs,
const QRegularExpression & rhs )
noexcept

Definition at line 1745 of file qregularexpression.cpp.

◆ convertToPcreOptions() [1/2]

static int convertToPcreOptions ( QRegularExpression::MatchOptions matchOptions)
static

Definition at line 693 of file qregularexpression.cpp.

◆ convertToPcreOptions() [2/2]

static int convertToPcreOptions ( QRegularExpression::PatternOptions patternOptions)
static

Definition at line 668 of file qregularexpression.cpp.

◆ isJitEnabled()

static bool isJitEnabled ( )
static

Definition at line 973 of file qregularexpression.cpp.

Referenced by QRegularExpressionPrivate::optimizePattern().

+ Here is the caller graph for this function:

◆ qtPcreCallback()

static pcre2_jit_stack_16 * qtPcreCallback ( void * )
static

Definition at line 965 of file qregularexpression.cpp.

Referenced by QRegularExpressionPrivate::doMatch().

+ Here is the caller graph for this function:

◆ qtWarnAboutInvalidRegularExpression()

Q_DECL_COLD_FUNCTION void qtWarnAboutInvalidRegularExpression ( const QString & pattern,
const char * where )

Used to centralize the warning about using an invalid QRegularExpression. In case the pattern is an illegal UTF-16 string, we can't pass print it (pass it to qUtf16Printable, etc.), so we need to check for that.

Definition at line 802 of file qregularexpression.cpp.

◆ safe_pcre2_match_16()

static int safe_pcre2_match_16 ( const pcre2_code_16 * code,
PCRE2_SPTR16 subject,
qsizetype length,
qsizetype startOffset,
int options,
pcre2_match_data_16 * matchData,
pcre2_match_context_16 * matchContext )
static

This is a simple wrapper for pcre2_match_16 for handling the case in which the JIT runs out of memory. In that case, we allocate a thread-local JIT stack and re-run pcre2_match_16.

Definition at line 1054 of file qregularexpression.cpp.