Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qregularexpression.cpp File Reference

(7b738ffc583a19138d9772d7ed84c8d771c85a77)

#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) noexcept
 
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 2733 of file qregularexpression.cpp.

Referenced by Graph< Vertex, EdgeData >::const_iterator::const_iterator(), QRandomGenerator::QRandomGenerator(), QFragmentMap< Fragment >::~QFragmentMap(), QMimeBinaryProvider::addParents(), QSpanPrivate::adl_begin(), 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(), QDirListing::cbegin(), QByteArray::cbegin(), QByteArrayView::cbegin(), QRegion::cbegin(), QIPAddressUtils::checkedToAscii(), SymbolsResolver::checkLibrariesLoaded(), QFragmentMap< Fragment >::clear(), QFutureInterfaceBasePrivate::connectOutputInterface(), QDirListing::constBegin(), 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(), QByteArray::end(), QByteArray::end(), ensureDetached(), QList< T >::erase(), QVLABase< T >::erase(), QString::erase(), QV4::ExecutionEngine::executableCompilationUnit(), 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(), fullConvertCase(), QRandomGenerator::generate(), QRandomGenerator::generate(), QRandomGenerator::SystemGenerator::generate(), QRandomGenerator::SystemGenerator::generate(), QEglFSKmsEventHost::handlePageFlipCompleted(), QMimeGlobPatternList::hasPattern(), Http2::Frame::hpackBlockBegin(), 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(), mappingBoundaries(), 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()(), QtPrivate::q_boyer_moore_searcher< RandomIt1, Hash, BinaryPredicate >::operator()(), SubArray::operator==(), QCborArray::operator[](), QMetaObjectPrivate::parameterTypeNamesFromSignature(), QUrlPrivate::parse(), parseAnimateColorNode(), parseAnimateTransformNode(), parseEnumFlags(), Parser::parseInstrument(), QIPAddressUtils::parseIp4(), QIPAddressUtils::parseIp6(), parseIp6(), parseIpFuture(), parsePosixOffset(), parsePosixTime(), QSSGShaderCustomMaterialAdapter::prepareCustomShader(), putEscapedString(), qDeleteAll(), qHash(), QtPrivate::qNormalizeType(), qSaveQmlJSUnitAsCpp(), qstrntoll(), qstrntoull(), qt_findClosestValue(), qstdweb::BlobIODevice::readData(), qstdweb::Uint8ArrayIODevice::readData(), QCborStreamReaderPrivate::readStringChunk_unicode(), recode(), recodeFromUser(), QString::remove(), QString::remove(), QVLABase< T >::remove(), removeOffsetRange(), removeStringImpl(), QByteArray::rend(), QString::rend(), QString::rend(), QByteArray::rend(), QByteArrayView::rend(), QRegion::rend(), QString::replace(), 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(), QOpenXRGraphicsVulkan::setupGraphics(), QIterable< Container >::size(), qstdweb::ArrayBuffer::slice(), qstdweb::Blob::slice(), qstdweb::File::slice(), QString::sliced(), QListModel::sortedInsertionIterator(), QTableModel::sortedInsertionIterator(), QTreeModel::sortedInsertionIterator(), sortParticles(), QtConcurrent::startFiltered(), QtConcurrent::startFilteredReduced(), QtConcurrent::startFilteredReduced(), QtConcurrent::startMap(), QtConcurrent::startMapped(), QtConcurrent::startMappedReduced(), QtConcurrent::startMappedReduced(), QV4::RuntimeHelpers::stringToNumber(), qstdweb::Uint8Array::subarray(), 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::typenameHelper(), unicodeToEncodedUtf8(), QQuickUniversalBusyIndicatorNode::updateCurrentTime(), QQuickUniversalProgressBarNode::updateCurrentTime(), AVFVideoSinkInterface::updateLayerBounds(), QEglFSKmsEventHost::updateStatus(), QUrlPrivate::validateComponent(), validatePosixRule(), and qstdweb::Uint8ArrayIODevice::writeData().

◆ comparesEqual()

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

Definition at line 1746 of file qregularexpression.cpp.

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

References ok, and qgetenv().

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 964 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 801 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 1053 of file qregularexpression.cpp.

Referenced by QRegularExpressionPrivate::doMatch().

+ Here is the caller graph for this function: