KySdkDisk.3 .\" -*- coding: utf-8 -*- .TH KySdkDisk 3 "Wed Sep 20 2023" "1.0" "Disk Information D-Bus Library" .SH NAME KySdkDisk \- Class for generating D-Bus signals for disk information .SH SYNOPSIS .nf .B #include .fi .SH DESCRIPTION .PP The \fBKySdkDisk\fR class is mainly used to generate D\-Bus signals for disk list, number of sectors, bytes per sector, capacity, model, serial number, number of sub-partitions, type, and firmware version information. .PP This class inherits from \fBQObject\fR. .SH "PUBLIC SLOTS" .PP .B "QStringList getDiskList () const" .RS .PP Get the list of all disks. .PP .B Return value: .RS .TP .B QStringList List of disks, each string represents the absolute path of a disk .RE .RE .PP .B "unsigned int getDiskSectorSize (const QString diskname) const" .RS .PP Get the number of bytes per sector of the disk. .PP .B Parameters: .RS .TP .B diskname Specify the disk name, should be an absolute path such as /dev/sda .RE .PP .B Return value: .RS .TP .B unsigned int Number of bytes per sector .RE .RE .PP .B "double getDiskTotalSizeMiB (const QString diskname) const" .RS .PP Get the disk capacity. .PP .B Parameters: .RS .TP .B diskname Specify the disk name, should be an absolute path such as /dev/sda .RE .PP .B Return value: .RS .TP .B double Disk capacity in MiB .RE .RE .PP .B "QString getDiskModel (const QString diskname) const" .RS .PP Get the disk model. .PP .B Parameters: .RS .TP .B diskname Specify the disk name, should be an absolute path such as /dev/sda .RE .PP .B Return value: .RS .TP .B QString Disk model .RE .RE .PP .B "QString getDiskSerial (const QString diskname) const" .RS .PP Get the disk serial number. .PP .B Parameters: .RS .TP .B diskname Specify the disk name, should be an absolute path such as /dev/sda .RE .PP .B Return value: .RS .TP .B QString Disk serial number .RE .RE .PP .B "unsigned int getDiskPartitionNums (const QString diskname) const" .RS .PP Get the number of sub-partitions under the disk/partition. .PP .B Parameters: .RS .TP .B diskname Specify the disk name, should be an absolute path such as /dev/sda .RE .PP .B Return value: .RS .TP .B unsigned int Number of sub-partitions under this disk/partition .RE .RE .PP .B "QString getDiskType (const QString diskname) const" .RS .PP Get the disk type. .PP .B Parameters: .RS .TP .B diskname Specify the disk name, should be an absolute path such as /dev/sda .RE .PP .B Return value: .RS .TP .B QString Disk type, SSD or HDD or Hybrid .RE .RE .PP .B "QString getDiskVersion (const QString diskname) const" .RS .PP Get the disk firmware version information. .PP .B Parameters: .RS .TP .B diskname Specify the disk name, should be an absolute path such as /dev/sda .RE .PP .B Return value: .RS .TP .B QString Firmware version information .RE .RE .PP .B "unsigned long long getDiskSectorNum (const QString diskname) const" .RS .PP Get the number of disk sectors. .PP .B Parameters: .RS .TP .B diskname Specify the disk name, should be an absolute path such as /dev/sda .RE .PP .B Return value: .RS .TP .B unsigned long long Number of sectors .RE .RE .SH "EXAMPLE USAGE" .PP .nf #include #include int main(int argc, char *argv[]) { QCoreApplication app(argc, argv); KySdkDisk diskInfo; // Get disk list QStringList disks = diskInfo.getDiskList(); // Get information of the first disk if (!disks.isEmpty()) { QString diskName = disks.first(); QString model = diskInfo.getDiskModel(diskName); double size = diskInfo.getDiskTotalSizeMiB(diskName); // ... use other methods } return 0; } .fi .SH "SEE ALSO" .BR QObject (3qt5), .BR D\-Bus (1), .BR libkyfilewatcher (3) .SH AUTHOR Generated automatically by Doxygen for kysdkdbus.h from the source code.