Solid

iokitblock.cpp
1/*
2 SPDX-FileCopyrightText: 2017 René J.V. Bertin <rjvbertin@gmail.com>
3
4 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5*/
6
7#include "iokitblock.h"
8
9#include "iokitdevice.h"
10
11using namespace Solid::Backends::IOKit;
12
13Block::Block(IOKitDevice *device)
14 : DeviceInterface(device)
15{
16}
17
18Block::Block(const IOKitDevice *device)
19 : DeviceInterface(device)
20{
21}
22
23Block::~Block()
24{
25}
26
27int Block::deviceMajor() const
28{
29 return m_device->property(QLatin1String("BSD Major")).toInt();
30}
31
32int Block::deviceMinor() const
33{
34 return m_device->property(QLatin1String("BSD Minor")).toInt();
35}
36
37QString Block::device() const
38{
39 if (m_device->iOKitPropertyExists(QStringLiteral("BSD Name"))) {
40 return QStringLiteral("/dev/") + m_device->property(QLatin1String("BSD Name")).toString();
41 }
42 return QString();
43}
44
45#include "moc_iokitblock.cpp"
int toInt(bool *ok) const const
QString toString() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 24 2024 11:56:28 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.