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
qlibrary.cpp File Reference

(8fc37349e32629c8cf84eae97e2e9d80b194de21)

#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 <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 <QtCore/q20map.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 214 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 196 of file qlibrary.cpp.

References errMsg.

◆ installCoverageTool()

static void installCoverageTool ( QLibraryPrivate * libPrivate)
static

Definition at line 280 of file qlibrary.cpp.

References qDebug, qUtf16Printable, qWarning, and ret.

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

+ 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 376 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 1160 of file qlibrary.cpp.

References qEnvironmentVariableIntValue().

+ Here is the call graph for this function:

◆ qt_get_metadata()

static bool qt_get_metadata ( QLibraryPrivate * priv,
QString * errMsg )
static

Definition at line 676 of file qlibrary.cpp.

References 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 165 of file qlibrary.cpp.

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

◆ i

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

Definition at line 195 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 44 of file qlibrary.cpp.

Referenced by QLibraryPrivate::updatePluginState().

◆ qt_library_data

Q_CONSTINIT QLibraryStore* qt_library_data = nullptr
static

Definition at line 330 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 331 of file qlibrary.cpp.

◆ qt_library_mutex

Q_CONSTINIT QBasicMutex qt_library_mutex
static

◆ QtBuildIsDebug

constexpr bool QtBuildIsDebug = true
staticconstexpr

Definition at line 54 of file qlibrary.cpp.

Referenced by QLibraryPrivate::updatePluginState().

◆ return

return { i, s_len - i }

Definition at line 201 of file qlibrary.cpp.

◆ s_len

qsizetype s_len

Definition at line 165 of file qlibrary.cpp.