Solid::Ifaces::Block Class

Header: #include <Block>
CMake: find_package(KF6 REQUIRED COMPONENTS Solid)
target_link_libraries(mytarget PRIVATE KF6::Solid)
Inherits: Solid::Ifaces::DeviceInterface

Public Functions

virtual ~Block() override
virtual QString device() const = 0
virtual int deviceMajor() const = 0
virtual int deviceMinor() const = 0
(since 6.15) virtual bool isSystem() const

Detailed Description

This device interface is available on block devices.

A block device is an addressable device such as drive or partition. It is possible to interact with such a device using a special file in the system.

Member Function Documentation

[override virtual noexcept] Block::~Block()

Destroys a Block object.

[pure virtual] QString Block::device() const

Retrieves the absolute path of the special file to interact with the device.

Returns the absolute path of the special file to interact with the device

[pure virtual] int Block::deviceMajor() const

Retrieves the major number of the node file to interact with the device.

@return the device major number

[pure virtual] int Block::deviceMinor() const

Retrieves the minor number of the node file to interact with the device.

Returns the device minor number

[virtual, since 6.15] bool Block::isSystem() const

Whether this block is considered a system block, that it requires additional permissions to access (mount/umount)

This function was introduced in 6.15.