kpmcore/src/core/copysource.h

45 lines
1.1 KiB
C
Raw Normal View History

/*
SPDX-FileCopyrightText: 2008 Volker Lanz <vl@fidra.de>
SPDX-FileCopyrightText: 2008 Laurent Montel <montel@kde.org>
SPDX-FileCopyrightText: 2016-2018 Andrius Štikonas <andrius@stikonas.eu>
SPDX-FileCopyrightText: 2018 Huzaifa Faruqui <huzaifafaruqui@gmail.com>
SPDX-License-Identifier: GPL-3.0-or-later
*/
#ifndef KPMCORE_COPYSOURCE_H
#define KPMCORE_COPYSOURCE_H
2016-04-18 17:14:31 +01:00
#include <QtGlobal>
class CopyTarget;
class QString;
/** Base class for something to copy from.
2015-07-13 15:16:36 +01:00
Abstract base class for all copy sources. Used in combination with CopyTarget
to implement moving, copying, backing up and restoring FileSystems.
2015-07-13 15:16:36 +01:00
@see CopyTarget
@author Volker Lanz <vl@fidra.de>
*/
class CopySource
{
2015-07-13 15:16:36 +01:00
Q_DISABLE_COPY(CopySource)
2015-07-13 15:16:36 +01:00
protected:
CopySource() {}
virtual ~CopySource() {}
2015-07-13 15:16:36 +01:00
public:
virtual bool open() = 0;
virtual QString path() const = 0;
2015-07-13 15:16:36 +01:00
virtual qint64 length() const = 0;
virtual bool overlaps(const CopyTarget& target) const = 0;
virtual qint64 firstByte() const = 0;
virtual qint64 lastByte() const = 0;
};
#endif