7#include "dadictionary_p.h"
9using namespace Solid::Backends::IOKit;
11DADictionary::DADictionary(
const IOKitDevice *device)
13 , daSession(DASessionCreate(kCFAllocatorDefault))
17 const QString devName = device->property(QStringLiteral(
"BSD Name")).
toString();
18 daRef = DADiskCreateFromBSDName(kCFAllocatorDefault, daSession, devName.
toStdString().c_str());
24DADictionary::~DADictionary()
37bool DADictionary::getDict()
43 daDict = DADiskCopyDescription(daRef);
45 return daDict !=
nullptr;
48void DADictionary::releaseDict()
56const QString DADictionary::stringForKey(
const CFStringRef key)
66CFURLRef DADictionary::cfUrLRefForKey(
const CFStringRef key)
68 CFURLRef ret =
nullptr;
70 ret = (
const CFURLRef)CFDictionaryGetValue(daDict, key);
77bool DADictionary::boolForKey(
const CFStringRef key,
bool &value)
80 const CFBooleanRef boolRef = (
const CFBooleanRef)CFDictionaryGetValue(daDict, key);
82 value = CFBooleanGetValue(boolRef);
85 return boolRef !=
nullptr;
QString fromCFString(CFStringRef string)
std::string toStdString() const const
QString toString() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:01:48 by
doxygen 1.12.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.