10#include <private/qcore_unix_p.h>
12#if defined(Q_OS_ANDROID)
13# include <sys/mount.h>
15# define QT_STATFS ::statfs
16# define QT_STATFSBUF struct statfs
17# if !defined(ST_RDONLY)
21# include <sys/statvfs.h>
22# if defined(QT_LARGEFILE_SUPPORT)
23# define QT_STATFSBUF struct statvfs64
24# define QT_STATFS ::statvfs64
26# define QT_STATFSBUF struct statvfs
27# define QT_STATFS ::statvfs
49 if (bOk && code >= 0x20 && code < 0x80) {
50 decoded +=
QChar(code);
64 static const char pathDiskByLabel[] =
"/dev/disk/by-label";
70 while (
it.hasNext()) {
78void QStorageInfoPrivate::doStat()
81 if (rootPath.isEmpty())
88void QStorageInfoPrivate::retrieveVolumeInfo()
97 bytesTotal = statfs_buf.f_blocks * statfs_buf.f_frsize;
98 bytesFree = statfs_buf.f_bfree * statfs_buf.f_frsize;
99 bytesAvailable = statfs_buf.f_bavail * statfs_buf.f_frsize;
102#if defined(Q_OS_ANDROID)
103#if defined(_STATFS_F_FLAGS)
104 readOnly = (statfs_buf.f_flags & ST_RDONLY) != 0;
107 readOnly = (statfs_buf.f_flag & ST_RDONLY) != 0;
124void QStorageInfoPrivate::initRootPath()
127 if (rootPath.isEmpty())
137 const QString oldRootPath = rootPath;
140 for (
auto &
info : infos) {
145 rootPath =
info.mountPoint;
147 fileSystemType =
info.fsType;
148 subvolume =
info.fsRoot;
157 return QList{root()};
160 for (MountInfo &
info : infos) {
IOBluetoothDevice * device
The QDirIterator class provides an iterator for directory entrylists.
void close() override
Calls QFileDevice::flush() and closes the file.
\inmodule QtCore \reentrant
bool isSymLink() const
Returns true if this object points to a symbolic link, shortcut, or alias; otherwise returns false.
QString symLinkTarget() const
QString fileName() const
Returns the name of the file, excluding the path.
qint64 size() const
Returns the file size in bytes.
QString canonicalFilePath() const
Returns the canonical path including the file name, i.e.
bool open(OpenMode flags) override
Opens the file using OpenMode mode, returning true if successful; otherwise false.
static QByteArray encodeName(const QString &fileName)
Converts fileName to an 8-bit encoding that you can use in native APIs.
static QString decodeName(const QByteArray &localFileName)
This does the reverse of QFile::encodeName() using localFileName.
QByteArray readAll()
Reads all remaining data from the device, and returns it as a byte array.
void push_back(parameter_type t)
qint64 bytesTotal() const
Returns the total volume size in bytes.
\macro QT_RESTRICTED_CAST_FROM_ASCII
int toInt(bool *ok=nullptr, int base=10) const
Returns the string converted to an int using base base, which is 10 by default and must be between 2 ...
void reserve(qsizetype size)
Ensures the string has space for at least size characters.
void clear()
Clears the contents of the string and makes it null.
qsizetype size() const
Returns the number of characters in this string.
QString mid(qsizetype position, qsizetype n=-1) const
Returns a string that contains n characters of this string, starting at the specified position index.
const QChar at(qsizetype i) const
Returns the character at the given index position in the string.
QString sliced(qsizetype pos) const
QSet< QString >::iterator it
Combined button and popup list for selecting options.
#define EINTR_LOOP(var, cmd)
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
static std::vector< MountInfo > parseMountInfo(FilterMountInfo filter=FilterMountInfo::All)
static QString retrieveLabel(const QByteArray &device)
static QString decodeFsEncString(const QString &str)
static std::vector< MountInfo > doParseMountInfo(const QByteArray &mountinfo, FilterMountInfo filter=FilterMountInfo::All)
QT_BEGIN_NAMESPACE static Q_LOGGING_CATEGORY(lcStorageInfo, "qt.core.qstorageinfo", QtWarningMsg) class QStorageInfoPrivate bool isParentOf(const String &parent, const QString &dirName)
QFileInfo info(fileName)
[8]