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
qstorageinfo.h
Go to the documentation of this file.
1// Copyright (C) 2014 Ivan Komissarov <ABBAPOH@gmail.com>
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QSTORAGEINFO_H
5#define QSTORAGEINFO_H
6
7#include <QtCore/qbytearray.h>
8#include <QtCore/qcompare.h>
9#include <QtCore/qdir.h>
10#include <QtCore/qlist.h>
11#include <QtCore/qmetatype.h>
12#include <QtCore/qstring.h>
13#include <QtCore/qshareddata.h>
14
16
17class QDebug;
18
19class QStorageInfoPrivate;
20class Q_CORE_EXPORT QStorageInfo
21{
22public:
24 explicit QStorageInfo(const QString &path);
25 explicit QStorageInfo(const QDir &dir);
28
29 QStorageInfo &operator=(const QStorageInfo &other);
30 QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(QStorageInfo)
31
32 inline void swap(QStorageInfo &other) noexcept
33 { d.swap(other.d); }
34
35 void setPath(const QString &path);
36
37 QString rootPath() const;
38 QByteArray device() const;
39 QByteArray subvolume() const;
40 QByteArray fileSystemType() const;
41 QString name() const;
42 QString displayName() const;
43
44 qint64 bytesTotal() const;
45 qint64 bytesFree() const;
46 qint64 bytesAvailable() const;
47 int blockSize() const;
48
49 inline bool isRoot() const;
50 bool isReadOnly() const;
51 bool isReady() const;
52 bool isValid() const;
53
54 void refresh();
55
56 static QList<QStorageInfo> mountedVolumes();
57 static QStorageInfo root();
58
59private:
60 explicit QStorageInfo(QStorageInfoPrivate &dd);
61 friend class QStorageInfoPrivate;
62 friend Q_CORE_EXPORT bool comparesEqual(const QStorageInfo &lhs, const QStorageInfo &rhs);
64
65 friend Q_CORE_EXPORT QDebug operator<<(QDebug, const QStorageInfo &);
66 QExplicitlySharedDataPointer<QStorageInfoPrivate> d;
67};
68
69inline bool QStorageInfo::isRoot() const
70{ return *this == QStorageInfo::root(); }
71
72Q_DECLARE_SHARED(QStorageInfo)
73
74#ifndef QT_NO_DEBUG_STREAM
75Q_CORE_EXPORT QDebug operator<<(QDebug debug, const QStorageInfo &);
76#endif
77
79
81
82#endif // QSTORAGEINFO_H
IOBluetoothDevice * device
\inmodule QtCore
Definition qbytearray.h:57
\inmodule QtCore
\inmodule QtCore
Definition qdir.h:20
\inmodule QtCore
bool isRoot() const
Returns true if this QStorageInfo represents the system root volume; false otherwise.
static QStorageInfo root()
Returns a QStorageInfo object that represents the system root volume.
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
Combined button and popup list for selecting options.
const int blockSize
static QString displayName(CGDirectDisplayID displayID)
#define Q_DECLARE_EQUALITY_COMPARABLE(...)
bool comparesEqual(const QDir &lhs, const QDir &rhs)
Definition qdir.cpp:1819
#define QT_DECL_METATYPE_EXTERN(TYPE, EXPORT)
Definition qmetatype.h:1388
GLuint name
GLsizei const GLchar *const * path
Q_CORE_EXPORT QDebug operator<<(QDebug debug, const QStorageInfo &)
long long qint64
Definition qtypes.h:60
QDataStream & operator<<(QDataStream &out, const MyClass &myObj)
[4]
QSharedPointer< T > other(t)
[5]
this swap(other)
QString dir
[11]