8#include <QtCore/qtconfigmacros.h>
10#include <QtCore/q17memory.h>
12#include <QtCore/q20type_traits.h>
35#ifdef __cpp_lib_constexpr_dynamic_alloc
43 return ::
new (
const_cast<
void *>(
static_cast<
const volatile void *>(ptr)))
44 T(
std::forward<Args>(args)...);
51#ifdef __cpp_lib_smart_ptr_for_overwrite
69template <
typename T,
typename...
Args>
78#ifdef __cpp_lib_to_address
86 static_assert(!
std::is_function_v<T>,
"to_address must not be used on function types");
90template <
typename Ptr,
typename std::enable_if_t<!std::is_pointer_v<Ptr>,
bool> =
true>
91constexpr auto to_address(
const Ptr &ptr)
noexcept;
95 template <
typename Ptr,
typename =
void>
97 static auto get(
const Ptr &ptr)
noexcept
98 {
return q20::to_address(ptr.operator->()); }
100 template <
typename Ptr>
112{
return detail::to_address_helper<Ptr>::get(ptr); }
constexpr T * to_address(T *p) noexcept
T * construct_at(T *ptr, Args &&... args)
constexpr auto to_address(const Ptr &ptr) noexcept
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
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)
static std::vector< MountInfo > doParseMountInfo(const QByteArray &mountinfo, FilterMountInfo filter=FilterMountInfo::All)
static auto get(const Ptr &ptr) noexcept