7#ifndef QSTORAGEINFO_LINUX_P_H
8#define QSTORAGEINFO_LINUX_P_H
23#include <QtCore/qsystemdetection.h>
24#include <QtCore/private/qlocale_tools_p.h>
26#include <sys/sysmacros.h>
42 int rdevmajor = int(
r.result);
52 return makedev(rdevmajor,
r.result);
68 const char *srcEnd =
path.data() +
path.size();
69 while (
src != srcEnd) {
77 char c = (*
src++ -
'0') << 6;
78 c |= (*
src++ -
'0') << 3;
98static constexpr short DevNo = 2;
113 size_t fieldIndex = 0;
124 static constexpr char separatorField[] =
" - ";
126 if (sepIndex == -1) {
128 "Malformed line (missing '-' separator field) while parsing '%s':\n%s",
134 from = sepIndex + strlen(separatorField);
149 "Expected %d fields while parsing line from '%s', but found %zu instead:\n%.*s",
164[[maybe_unused]]
static std::vector<MountInfo>
172 const auto end = mountinfo.cend();
174 auto nIt = std::find(
it,
end,
'\n');
183 std::vector<MountInfo> infos;
184 std::array<QByteArrayView, FieldCount> fields;
188 if (field.isEmpty()) {
197 while (!(
line = nextLine()).isEmpty()) {
203 if (!checkField(mountP))
207 if (!checkField(fields[
FsType]))
222 if (!checkField(fsRootView))
227 if (fsRootView !=
"/") {
229 if (!checkField(
info.fsRoot))
234 if (!checkField(
info.device))
237 infos.push_back(std::move(
info));
static QString decodeName(const QByteArray &localFileName)
This does the reverse of QFile::encodeName() using localFileName.
const_iterator cbegin() const noexcept
qsizetype indexOf(QLatin1StringView s, qsizetype from=0, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
const QChar * constData() const
Returns a pointer to the data stored in the QString.
qsizetype size() const noexcept
Returns the number of characters in this string.
QChar * data()
Returns a pointer to the data stored in the QString.
QSet< QString >::iterator it
Combined button and popup list for selecting options.
#define qCInfo(category,...)
#define qCWarning(category,...)
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
GLsizei const GLchar *const * path
QtPrivate::QRegularExpressionMatchIteratorRangeBasedForIterator begin(const QRegularExpressionMatchIterator &iterator)
static constexpr short MountSource
static constexpr short FsType
static std::vector< MountInfo > doParseMountInfo(const QByteArray &mountinfo, FilterMountInfo filter=FilterMountInfo::All)
static std::optional< dev_t > deviceNumber(QByteArrayView devno)
static constexpr short FieldCount
static constexpr short FsRoot
static QByteArray parseMangledPath(QByteArrayView path)
static const char MountInfoPath[]
QStorageInfoPrivate::MountInfo MountInfo
static constexpr short MountOptions
static void tokenizeLine(std::array< QByteArrayView, FieldCount > &fields, QByteArrayView line)
static constexpr short DevNo
static constexpr short MountPoint
static constexpr short SuperOptions
static bool shouldIncludeFs(const QString &mountDir, const QByteArray &fsType)