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

(797d91fd7ca697b6a4bdb0db75b1866991696834)

#include "qqmlfile.h"
#include <QtCore/qurl.h>
#include <QtCore/qobject.h>
#include <QtCore/qmetaobject.h>
#include <QtCore/qfile.h>
#include <private/qqmlengine_p.h>
#include <private/qqmlglobal_p.h>
#include <private/qurl_p.h>
#include "qqmlfile.moc"
Include dependency graph for qqmlfile.cpp:

Go to the source code of this file.

Functions

static bool hasScheme (const QString &url, QLatin1StringView scheme)
static qsizetype authorityOffset (const QString &url, qsizetype schemeLength)
static QString toLocalFile (const QString &url)
static bool isDoubleSlashed (const QString &url, qsizetype offsetoffset)
static QStringView stripQueryAndFragment (QStringView pathpath)
static bool needsDecoding (QStringView pathpath)
static QString qrcPathToLocalPath (const QString &url, QStringView pathpath)

Variables

static constexpr QLatin1StringView qrc_string { "qrc" }
static constexpr QLatin1StringView file_string { "file" }

Function Documentation

◆ authorityOffset()

qsizetype authorityOffset ( const QString & url,
qsizetype schemeLength )
static

Definition at line 649 of file qqmlfile.cpp.

◆ hasScheme()

bool hasScheme ( const QString & url,
QLatin1StringView scheme )
static

Definition at line 632 of file qqmlfile.cpp.

◆ isDoubleSlashed()

bool isDoubleSlashed ( const QString & url,
qsizetype offset )
static

Definition at line 778 of file qqmlfile.cpp.

◆ needsDecoding()

bool needsDecoding ( QStringView path)
static

Definition at line 814 of file qqmlfile.cpp.

◆ qrcPathToLocalPath()

QString qrcPathToLocalPath ( const QString & url,
QStringView path )
static

Definition at line 823 of file qqmlfile.cpp.

◆ stripQueryAndFragment()

QStringView stripQueryAndFragment ( QStringView path)
static

Returns path, the remainder of a URL string after the scheme, without its query and fragment.

This is safe because path is part of a URL, not a file name: In a URL, the path ends at the first '?' or '#'. A literal '?' or '#' that is part of a path segment has to be percent-encoded, so the first unencoded one is always the delimiter. Encoded ones ("%3F", "%23") don't contain the delimiter characters and are left alone. This is what QUrl::path() does, and what the file: case gets from QUrl::toLocalFile().

Definition at line 806 of file qqmlfile.cpp.

◆ toLocalFile()

QString toLocalFile ( const QString & url)
static

Definition at line 766 of file qqmlfile.cpp.

Variable Documentation

◆ file_string

constexpr QLatin1StringView file_string { "file" }
staticconstexpr

Definition at line 28 of file qqmlfile.cpp.

◆ qrc_string

constexpr QLatin1StringView qrc_string { "qrc" }
staticconstexpr

Definition at line 27 of file qqmlfile.cpp.