KDiskFreeSpaceInfo
#include <KDiskFreeSpaceInfo>
Public Member Functions | |
KDiskFreeSpaceInfo (const KDiskFreeSpaceInfo &) | |
~KDiskFreeSpaceInfo () | |
KIO::filesize_t | available () const |
bool | isValid () const |
QString | mountPoint () const |
KDiskFreeSpaceInfo & | operator= (const KDiskFreeSpaceInfo &) |
KIO::filesize_t | size () const |
KIO::filesize_t | used () const |
Static Public Member Functions | |
static KDiskFreeSpaceInfo | freeSpaceInfo (const QString &path) |
Detailed Description
Determine the space left on an arbitrary partition.
This class determines the free space left on the partition that holds a given path. This path can be the mount point or any file or directory on the partition.
To find how much space is available on the partition containing path
, simply do the following:
- Since
- 4.2
- Deprecated:
- Since 5.88, use KIO::FileSystemFreeSpaceJob or QStorageInfo instead.
Definition at line 44 of file kdiskfreespaceinfo.h.
Constructor & Destructor Documentation
◆ KDiskFreeSpaceInfo()
KDiskFreeSpaceInfo::KDiskFreeSpaceInfo | ( | const KDiskFreeSpaceInfo & | other | ) |
Copy constructor.
Definition at line 41 of file kdiskfreespaceinfo.cpp.
◆ ~KDiskFreeSpaceInfo()
KDiskFreeSpaceInfo::~KDiskFreeSpaceInfo | ( | ) |
Destructor.
Definition at line 46 of file kdiskfreespaceinfo.cpp.
Member Function Documentation
◆ available()
KIO::filesize_t KDiskFreeSpaceInfo::available | ( | ) | const |
The available space in the partition mounted at mountPoint()
Only valid if isValid() returns true
.
- Returns
- Available space left on the requested partition in bytes.
Definition at line 71 of file kdiskfreespaceinfo.cpp.
◆ freeSpaceInfo()
|
static |
Static method used to determine the free disk space.
- Parameters
-
path An arbitrary path. The available space will be determined for the partition containing path.
Check isValid() to see if the process was successful. Then use mountPoint(), size(), available(), and used() to access the requested values.
- Deprecated:
- Since 5.88, use KIO::FileSystemFreeSpaceJob or QStorageInfo instead.
Definition at line 81 of file kdiskfreespaceinfo.cpp.
◆ isValid()
bool KDiskFreeSpaceInfo::isValid | ( | ) | const |
- Returns
true
if the available disk space was successfully determined and the values from mountPoint(), size(), available(), and used() are valid.false
otherwise.
Definition at line 56 of file kdiskfreespaceinfo.cpp.
◆ mountPoint()
QString KDiskFreeSpaceInfo::mountPoint | ( | ) | const |
The mount point of the partition the requested path points to.
Only valid if isValid() returns true
.
Definition at line 61 of file kdiskfreespaceinfo.cpp.
◆ operator=()
KDiskFreeSpaceInfo & KDiskFreeSpaceInfo::operator= | ( | const KDiskFreeSpaceInfo & | other | ) |
Assignment operator.
Definition at line 50 of file kdiskfreespaceinfo.cpp.
◆ size()
KIO::filesize_t KDiskFreeSpaceInfo::size | ( | ) | const |
The total size of the partition mounted at mountPoint()
Only valid if isValid() returns true
.
- Returns
- Total size of the requested partition in bytes.
Definition at line 66 of file kdiskfreespaceinfo.cpp.
◆ used()
KIO::filesize_t KDiskFreeSpaceInfo::used | ( | ) | const |
The used space in the partition mounted at mountPoint()
Only valid if isValid() returns true
.
- Returns
- Used space on the requested partition in bytes.
Definition at line 76 of file kdiskfreespaceinfo.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2022 The KDE developers.
Generated on Fri Aug 12 2022 03:49:32 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.