#pragma once #include #include #include #include class DeviceInfo { public: QString model; QString transport; QString size; long sec_ph; long sec_log; DeviceInfo(): size(0), sec_ph(0), sec_log(0) {} }; class PartitionInfo { public: int num; long begin; long end; QString size; QString type; QString fs; QString name; long flags; PartitionInfo(): num(0), begin(0), end(0), size(0), flags(0) {} }; typedef QMap Partitions; typedef QMap Devices; class LibPartedError { public: LibPartedError() {} virtual ~LibPartedError() {} }; class LibParted : public QObject { Q_OBJECT public: explicit LibParted(QObject *parent = 0); ~LibParted(); public: QString getVersion(); void Init(); QStringList getDevices(); DeviceInfo getDeviceInfo(const QString& path) throw(LibPartedError); QList getPartitionList(const QString& path) throw(LibPartedError); private: DeviceInfo convertPedDevice(const PedDevice* dev); QString sizeHuman(const long long size); private: Devices m_DeviceList; };