File indexing completed on 2024-05-12 05:48:27

0001 /*
0002     SPDX-FileCopyrightText: 2010 Volker Lanz <vl@fidra.de>
0003     SPDX-FileCopyrightText: 2014-2018 Andrius Štikonas <andrius@stikonas.eu>
0004     SPDX-FileCopyrightText: 2015 Teo Mrnjavac <teo@kde.org>
0005 
0006     SPDX-License-Identifier: GPL-3.0-or-later
0007 */
0008 
0009 #include "plugins/dummy/dummydevice.h"
0010 #include "plugins/dummy/dummypartitiontable.h"
0011 
0012 #include "core/partitiontable.h"
0013 
0014 #include "util/globallog.h"
0015 #include "util/report.h"
0016 
0017 DummyDevice::DummyDevice(const QString& deviceNode) :
0018     CoreBackendDevice(deviceNode)
0019 {
0020 }
0021 
0022 DummyDevice::~DummyDevice()
0023 {
0024 }
0025 
0026 bool DummyDevice::open()
0027 {
0028     return true;
0029 }
0030 
0031 bool DummyDevice::openExclusive()
0032 {
0033     return true;
0034 }
0035 
0036 bool DummyDevice::close()
0037 {
0038     return true;
0039 }
0040 
0041 std::unique_ptr<CoreBackendPartitionTable> DummyDevice::openPartitionTable()
0042 {
0043     return std::make_unique<DummyPartitionTable>(DummyPartitionTable());
0044 }
0045 
0046 bool DummyDevice::createPartitionTable(Report& report, const PartitionTable& ptable)
0047 {
0048     Q_UNUSED(report)
0049     Q_UNUSED(ptable)
0050 
0051     return true;
0052 }