Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qlibrary.cpp File Reference
#include "qlibrary.h"
#include "qlibrary_p.h"
#include <q20algorithm.h>
#include <qbytearraymatcher.h>
#include <qdebug.h>
#include <qendian.h>
#include <qfile.h>
#include <qfileinfo.h>
#include <qjsondocument.h>
#include <qmap.h>
#include <qmutex.h>
#include <qoperatingsystemversion.h>
#include <qstringlist.h>
#include <private/qcoreapplication_p.h>
#include <private/qloggingregistry_p.h>
#include <private/qsystemerror_p.h>
#include "qcoffpeparser_p.h"
#include "qelfparser_p.h"
#include "qfactoryloader_p.h"
#include "qmachparser_p.h"
#include <qtcore_tracepoints_p.h>
#include "moc_qlibrary.cpp"
+ Include dependency graph for qlibrary.cpp:

Go to the source code of this file.

Classes

class  QLibraryStore
 

Functions

 Q_TRACE_POINT (qtcore, QLibraryPrivate_load_entry, const QString &fileName)
 
 Q_TRACE_POINT (qtcore, QLibraryPrivate_load_exit, bool success)
 
 if (i< 0)
 
static QLibraryScanResult findPatternUnloaded (const QString &library, QLibraryPrivate *lib)
 
static void installCoverageTool (QLibraryPrivate *libPrivate)
 
static void qlibraryCleanup ()
 
static bool qt_get_metadata (QLibraryPrivate *priv, QString *errMsg)
 
bool qt_debug_component ()
 

Variables

static constexpr bool PluginMustMatchQtDebug
 
static constexpr bool QtBuildIsDebug = true
 
qsizetype s_len
 
qsizetype QStringerrMsg
 
qsizetype i = matcher.indexIn({s, s_len})
 
 return { i, s_len - i }
 
static Q_CONSTINIT QBasicMutex qt_library_mutex
 
static Q_CONSTINIT QLibraryStoreqt_library_data = nullptr
 
static Q_CONSTINIT bool qt_library_data_once
 

Function Documentation

◆ findPatternUnloaded()

static QLibraryScanResult findPatternUnloaded ( const QString library,
QLibraryPrivate lib 
)
static

Definition at line 213 of file qlibrary.cpp.

References QString::arg(), QByteArray::constData(), errMsg, QIODevice::errorString(), QPluginParsedMetaData::errorString(), QLibraryPrivate::errorString, file, QFileDevice::map(), QLibraryPrivate::metaData, QFile::open(), QPluginParsedMetaData::parse(), Q_INT64_C, qCDebug, qCWarning, qMin(), qUtf16Printable, QIODevice::read(), QIODeviceBase::ReadOnly, QFile::size(), QPluginParsedMetaData::toJson(), and QJsonDocument::toJson().

Referenced by QLibraryPrivate::updatePluginState().

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

◆ if()

if ( )

Definition at line 195 of file qlibrary.cpp.

References QString::arg(), and errMsg.

+ Here is the call graph for this function:

◆ installCoverageTool()

static void installCoverageTool ( QLibraryPrivate libPrivate)
static

Definition at line 279 of file qlibrary.cpp.

References QLibraryPrivate::fileName, qDebug, qUtf16Printable, qWarning, ret, and QString::toLocal8Bit().

Referenced by QLibraryPrivate::load(), and QTest::qtest_qParseArgs().

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

◆ Q_TRACE_POINT() [1/2]

Q_TRACE_POINT ( qtcore  ,
QLibraryPrivate_load_entry  ,
const QString fileName 
)

◆ Q_TRACE_POINT() [2/2]

Q_TRACE_POINT ( qtcore  ,
QLibraryPrivate_load_exit  ,
bool  success 
)

◆ qlibraryCleanup()

static void qlibraryCleanup ( )
static

Definition at line 378 of file qlibrary.cpp.

References QLibraryStore::cleanup().

+ Here is the call graph for this function:

◆ qt_debug_component()

bool qt_debug_component ( )

Definition at line 1151 of file qlibrary.cpp.

References qEnvironmentVariableIntValue(), and QT_PREPEND_NAMESPACE().

+ Here is the call graph for this function:

◆ qt_get_metadata()

static bool qt_get_metadata ( QLibraryPrivate priv,
QString errMsg 
)
static

Definition at line 669 of file qlibrary.cpp.

References QString::arg(), QPluginMetaData::data, errMsg, error, QPluginMetaData::MagicString, priv(), and QPluginMetaData::size.

Referenced by QLibraryPrivate::updatePluginState().

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

Variable Documentation

◆ errMsg

qsizetype QString* errMsg
Initial value:
{
static constexpr auto matcher = [] {
constexpr auto &pattern = "QTMETADATA !";
constexpr auto magic = std::string_view(QPluginMetaData::MagicString,
static_assert(pattern == magic);
}()
constexpr QStaticByteArrayMatcher< N > qMakeStaticByteArrayMatcher(const char(&pattern)[N]) noexcept
GLubyte * pattern
static const uchar magic[MagicLength]
static const auto matcher
[0]
static constexpr char MagicString[]
Definition qplugin.h:40

Definition at line 164 of file qlibrary.cpp.

Referenced by findPatternUnloaded(), if(), and qt_get_metadata().

◆ i

i = matcher.indexIn({s, s_len})

Definition at line 194 of file qlibrary.cpp.

◆ PluginMustMatchQtDebug

constexpr bool PluginMustMatchQtDebug
staticconstexpr
Initial value:
=
static constexpr OSType currentType()
Returns the current OS type without constructing a QOperatingSystemVersion instance.

Definition at line 43 of file qlibrary.cpp.

Referenced by QLibraryPrivate::updatePluginState().

◆ qt_library_data

Q_CONSTINIT QLibraryStore* qt_library_data = nullptr
static

Definition at line 329 of file qlibrary.cpp.

Referenced by QLibraryStore::~QLibraryStore(), and QLibraryStore::cleanup().

◆ qt_library_data_once

Q_CONSTINIT bool qt_library_data_once
static

Definition at line 330 of file qlibrary.cpp.

◆ qt_library_mutex

Q_CONSTINIT QBasicMutex qt_library_mutex
static

◆ QtBuildIsDebug

constexpr bool QtBuildIsDebug = true
staticconstexpr

Definition at line 53 of file qlibrary.cpp.

Referenced by QLibraryPrivate::updatePluginState().

◆ return

return { i, s_len - i }

Definition at line 200 of file qlibrary.cpp.

◆ s_len

qsizetype s_len

Definition at line 164 of file qlibrary.cpp.