7#include "iokitopticaldisc.h"
9#include <CoreFoundation/CoreFoundation.h>
11using namespace Solid::Backends::IOKit;
13IOKitOpticalDisc::IOKitOpticalDisc(IOKitDevice *device)
18IOKitOpticalDisc::IOKitOpticalDisc(
const IOKitDevice *device)
23IOKitOpticalDisc::~IOKitOpticalDisc()
27QString IOKitOpticalDisc::device()
const
31 return QStringLiteral(
"/dev/") + devName;
33 return QStringLiteral(
"/dev/r") + devName;
39 if (fsType() == QStringLiteral(
"cddafs")) {
40 return Solid::OpticalDisc::Audio;
42 return Solid::OpticalDisc::Data;
49 if (type ==
"CD-ROM") {
50 return Solid::OpticalDisc::CdRom;
51 }
else if (type ==
"CD-R") {
52 return Solid::OpticalDisc::CdRecordable;
53 }
else if (type ==
"CD-RW") {
54 return Solid::OpticalDisc::CdRewritable;
55 }
else if (type ==
"DVD-ROM") {
56 return Solid::OpticalDisc::DvdRom;
57 }
else if (type ==
"DVD-RAM") {
58 return Solid::OpticalDisc::DvdRam;
59 }
else if (type ==
"DVD-R") {
60 return Solid::OpticalDisc::DvdRecordable;
61 }
else if (type ==
"DVD-RW") {
62 return Solid::OpticalDisc::DvdRewritable;
63 }
else if (type ==
"DVD+R") {
64 return Solid::OpticalDisc::DvdPlusRecordable;
65 }
else if (type ==
"DVD+RW") {
66 return Solid::OpticalDisc::DvdPlusRewritable;
67 }
else if (type ==
"BD-ROM") {
68 return Solid::OpticalDisc::BluRayRom;
69 }
else if (type ==
"BD-R") {
70 return Solid::OpticalDisc::BluRayRecordable;
71 }
else if (type ==
"BD-RE") {
72 return Solid::OpticalDisc::BluRayRewritable;
73 }
else if (type ==
"HD DVD-ROM") {
74 return Solid::OpticalDisc::HdDvdRom;
75 }
else if (type ==
"HD DVD-R") {
76 return Solid::OpticalDisc::HdDvdRecordable;
77 }
else if (type ==
"HD DVD-RW") {
78 return Solid::OpticalDisc::HdDvdRewritable;
80 return Solid::OpticalDisc::UnknownDiscType;
84bool IOKitOpticalDisc::isAppendable()
const
87 return isRewritable();
90bool IOKitOpticalDisc::isBlank()
const
93 return isRewritable();
96bool IOKitOpticalDisc::isRewritable()
const
98 return m_device->property(QStringLiteral(
"Writable")).
toBool();
101qulonglong IOKitOpticalDisc::capacity()
const
106#include "moc_iokitopticaldisc.cpp"
DiscType
This enum type defines the type of optical disc it can be.
VehicleSection::Type type(QStringView coachNumber, QStringView coachClassification)
bool startsWith(QChar c, Qt::CaseSensitivity cs) const const
bool toBool() const const
QString toString() const const