Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qregularexpression.cpp File Reference
#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)
 
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()

Definition at line 2755 of file qregularexpression.cpp.

Referenced by Graph< Vertex, EdgeData >::const_iterator::const_iterator(), QRandomGenerator::QRandomGenerator(), QMimeBinaryProvider::addParents(), Http2::FrameWriter::append(), argumentTypesFromString(), QVLABase< T >::assign_impl(), QtConcurrent::blockingFiltered(), QtConcurrent::blockingFiltered(), QtConcurrent::blockingFilteredReduced(), QtConcurrent::blockingFilteredReduced(), QtConcurrent::blockingFilteredReduced(), QtConcurrent::blockingFilteredReduced(), QtConcurrent::blockingMap(), QtConcurrent::blockingMap(), QtConcurrent::blockingMapped(), QtConcurrent::blockingMapped(), QtConcurrent::blockingMappedReduced(), QtConcurrent::blockingMappedReduced(), QtConcurrent::blockingMappedReduced(), QtConcurrent::blockingMappedReduced(), QKdPointTree::build(), calculatePosixTransitions(), QByteArray::cbegin(), QByteArrayView::cbegin(), QRegion::cbegin(), QIPAddressUtils::checkedToAscii(), QFutureInterfaceBasePrivate::connectOutputInterface(), QVarLengthArray< T, Prealloc >::constBegin(), QByteArray::constBegin(), QVLABase< T >::contains(), QUtf8::convertToUnicode(), QString::crend(), dataToUrls(), decode(), QQmlJS::Dom::FormatPartialStatus::defaultOnEnter(), do_mirror(), QQmlTypeData::done(), QQC2::QWindowsXPStyle::drawControl(), QWindowsVistaStyle::drawControl(), QCosmeticStroker::drawPath(), QList< T >::emplace(), QVLABase< T >::emplace_impl(), encodedUtf8ToUtf16(), ensureDetached(), QList< T >::erase(), QVLABase< T >::erase(), executeBlockWithoutAnimation(), QBitArray::fill(), QtConcurrent::filtered(), QtConcurrent::filtered(), QtConcurrent::filteredReduced(), QtConcurrent::filteredReduced(), QtConcurrent::filteredReduced(), QtConcurrent::filteredReduced(), Parser::findEnumValues(), findLineEnd(), QtPrivate::findString(), QCborArray::first(), QTextDocumentLayoutPrivate::frameIteratorForTextPosition(), QV4::JsonObject::fromJsonObject(), QChar::fromUcs4(), fullConvertCase(), QRandomGenerator::generate(), QRandomGenerator::generate(), QRandomGenerator::SystemGenerator::generate(), QRandomGenerator::SystemGenerator::generate(), QEglFSKmsEventHost::handlePageFlipCompleted(), QMimeGlobPatternList::hasPattern(), Http2::Frame::hpackBlockBegin(), QLatin1StringMatcher::indexIn(), indexOf(), QJSList< List, Value >::indexOf(), QJSList< List, Value >::indexOf(), QVarLengthArray< T, Prealloc >::insert(), QVarLengthArray< T, Prealloc >::insert(), QList< T >::insert(), insert_helper(), QVLABase< T >::insert_impl(), QtPrivate::QCalendarModel::internalUpdate(), isBlankLine(), QQmlDelegateModelPrivate::itemsRemoved(), QCborArray::last(), QVLABase< T >::lastIndexOf(), QJSList< List, Value >::lastIndexOf(), QJSList< List, Value >::lastIndexOf(), macQuoteString(), QtConcurrent::map(), QtConcurrent::map(), QtConcurrent::mapped(), QtConcurrent::mapped(), QtConcurrent::mappedReduced(), QtConcurrent::mappedReduced(), QtConcurrent::mappedReduced(), QtConcurrent::mappedReduced(), QQmlJSTypeResolver::memberType(), QV4::GlobalFunctions::method_parseFloat(), QV4::PropertyListPrototype::method_sort(), QV4::IntrinsicTypedArrayPrototype::method_subarray(), QQmlMetaType::moduleImports(), QtPrivate::QTypeNormalizer::normalizeType(), QtPrivate::QTypeNormalizer::normalizeTypeFromSignature(), Compress::operator()(), QtPrivate::q_boyer_moore_searcher_hashed_needle< RandomIt1, Hash, BinaryPredicate >::operator()(), SubArray::operator==(), QCborArray::operator[](), QMetaObjectPrivate::parameterTypeNamesFromSignature(), QUrlPrivate::parse(), parseAnimateColorNode(), parseAnimateTransformNode(), Parser::parseInstrument(), QIPAddressUtils::parseIp4(), QIPAddressUtils::parseIp6(), parseIp6(), parseIpFuture(), parsePosixOffset(), parsePosixTime(), QSSGShaderCustomMaterialAdapter::prepareCustomShader(), putEscapedString(), qDeleteAll(), qHash(), QtPrivate::qNormalizeType(), qSaveQmlJSUnitAsCpp(), qstrntoll(), qstrntoull(), qt_findClosestValue(), QCborStreamReaderPrivate::readStringChunk_unicode(), recode(), recodeFromUser(), QVLABase< T >::remove(), removeOffsetRange(), removeStringImpl(), QByteArray::rend(), QString::rend(), QString::rend(), QByteArray::rend(), QByteArrayView::rend(), QRegion::rend(), replace_in_place(), QtConcurrent::ResultReporter< T >::reportResults(), QMimeBinaryProvider::resolveAlias(), QDateTimeParser::sectionSize(), QSSGSceneDesc::PropertyListSetter< Ret, Class, Arg >::set(), QSSGSceneDesc::PropertyListSetter< Ret, Class, Arg >::set(), QUrlPrivate::setHost(), QUrlQueryPrivate::setQuery(), QIterable< Container >::size(), qstdweb::File::slice(), QV4::ArrayData::sort(), QListModel::sortedInsertionIterator(), QTableModel::sortedInsertionIterator(), QTreeModel::sortedInsertionIterator(), sortParticles(), QtConcurrent::startFiltered(), QtConcurrent::startFilteredReduced(), QtConcurrent::startFilteredReduced(), QtConcurrent::startMap(), QtConcurrent::startMapped(), QtConcurrent::startMappedReduced(), QtConcurrent::startMappedReduced(), QV4::RuntimeHelpers::stringToNumber(), QCborArray::takeAt(), Preprocessor::tokenize(), tokenizeLine(), QWasmScreen::topLevelAt(), QQmlJSUtils::traverseFollowingMetaObjectHierarchy(), QStringAlgorithms< StringType >::trimmed_helper(), QStringAlgorithms< StringType >::trimmed_helper_inplace(), QStringAlgorithms< StringType >::trimmed_helper_positions(), QV4::SparseArrayData::truncate(), QtPrivate::typenameHelper(), unicodeToEncodedUtf8(), QQuickUniversalBusyIndicatorNode::updateCurrentTime(), QQuickUniversalProgressBarNode::updateCurrentTime(), AVFVideoSinkInterface::updateLayerBounds(), QEglFSKmsEventHost::updateStatus(), QUrlPrivate::validateComponent(), and validatePosixRule().

◆ convertToPcreOptions() [1/2]

static int convertToPcreOptions ( QRegularExpression::MatchOptions  matchOptions)
static

◆ convertToPcreOptions() [2/2]

static int convertToPcreOptions ( QRegularExpression::PatternOptions  patternOptions)
static

◆ isJitEnabled()

static bool isJitEnabled ( )
static

Definition at line 971 of file qregularexpression.cpp.

References QByteArray::isEmpty(), ok, qgetenv(), and QByteArray::toInt().

Referenced by QRegularExpressionPrivate::optimizePattern().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qtPcreCallback()

static pcre2_jit_stack_16 * qtPcreCallback ( void )
static

Definition at line 963 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 800 of file qregularexpression.cpp.

References qUtf16Printable, and qWarning.

Referenced by QRegularExpressionPrivate::doMatch().

+ Here is the caller graph for this function:

◆ 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 1052 of file qregularexpression.cpp.

Referenced by QRegularExpressionPrivate::doMatch().

+ Here is the caller graph for this function: