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
qstorageinfo_linux_p.h
Go to the documentation of this file.
1// Copyright (C) 2021 The Qt Company Ltd.
2// Copyright (C) 2014 Ivan Komissarov <ABBAPOH@gmail.com>
3// Copyright (C) 2016 Intel Corporation.
4// Copyright (C) 2023 Ahmad Samir <a.samirh78@gmail.com>
5// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
6
7#ifndef QSTORAGEINFO_LINUX_P_H
8#define QSTORAGEINFO_LINUX_P_H
9
10//
11// W A R N I N G
12// -------------
13//
14// This file is not part of the Qt API.
15// This header file may change from version to
16// version without notice, or even be removed.
17//
18// We mean it.
19//
20
21#include "qstorageinfo_p.h"
22
23#include <sys/sysmacros.h> // makedev()
24
25QT_BEGIN_NAMESPACE
26
27using MountInfo = QStorageInfoPrivate::MountInfo;
28
29// parseMountInfo() is called from:
30// - QStorageInfoPrivate::initRootPath(), where a list of all mounted volumes is needed
31// - QStorageInfoPrivate::mountedVolumes(), where some filesystem types are ignored
32// (see shouldIncludefs())
33enum class FilterMountInfo {
34 All,
36};
37
38#ifdef QT_BUILD_INTERNAL
39Q_AUTOTEST_EXPORT
40#else
41static
42#endif
44 const QByteArray &mountinfo, FilterMountInfo filter = FilterMountInfo::All);
45
46QT_END_NAMESPACE
47
48#endif // QSTORAGEINFO_LINUX_P_H
static QString retrieveLabel(const QStorageInfoPrivate &d, int fd, quint64 deviceId)
static constexpr short MountId
static quint64 retrieveDeviceId(const QByteArray &device, quint64 deviceId=0)
static const char MountInfoPath[]
static constexpr short MountPoint
static constexpr short MountSource
static constexpr short FieldCount
static quint64 mountIdForPath(int fd)
static constexpr short MountOptions
std::vector< MountInfo > doParseMountInfo(const QByteArray &mountinfo, FilterMountInfo filter)
static constexpr short FsType
static std::optional< dev_t > deviceNumber(QByteArrayView devno)
static std::optional< QString > retrieveLabelViaIoctl(int fd)
#define FS_IOC_GETFSLABEL
static constexpr short DevNo
#define ST_RDONLY
static QByteArray parseMangledPath(QByteArrayView path)
static constexpr short SuperOptions
static QDirListing devicesByLabel()
static constexpr short FsRoot
static QString decodeFsEncString(QString &&str)
static std::vector< MountInfo > parseMountInfo(FilterMountInfo filter=FilterMountInfo::All)
static auto retrieveLabels()
static void tokenizeLine(std::array< QByteArrayView, FieldCount > &fields, QByteArrayView line)
static dev_t deviceIdForPath(const QString &device)
#define FSLABEL_MAX
static std::vector< MountInfo > doParseMountInfo(const QByteArray &mountinfo, FilterMountInfo filter=FilterMountInfo::All)