akabeidelta.h 1.32 KB
Newer Older
Dario Freddi's avatar
Dario Freddi committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14
/*
   This file is part of the Chakra project

   Copyright (C) 2010 Dario Freddi <drf@chakra-project.org>

   This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.
*/

#ifndef AKABEI_AKABEIDELTA_H
#define AKABEI_AKABEIDELTA_H

15 16
#include <QObject>

Dario Freddi's avatar
Dario Freddi committed
17 18 19 20

namespace Akabei {

class DeltaPrivate;
21

Dario Freddi's avatar
Dario Freddi committed
22 23 24 25 26 27 28 29 30
class Delta {
    Q_DISABLE_COPY(Delta)
    Q_DECLARE_PRIVATE(Delta)
    public:
        virtual ~Delta();

        QByteArray md5sum() const;

        QString targetName() const;
31 32
        QByteArray versionFrom() const;
        QByteArray versionTo() const;
Dario Freddi's avatar
Dario Freddi committed
33 34 35 36 37 38 39 40 41 42 43 44 45 46

        QString filename() const;

        bool checkMD5Sum();

        QString xdeltaApplyCommand(const QString &pathToDestination) const;

        QString pathToDelta() const;
        void setPathToDelta(const QString &path);

        QString pathToSource() const;
        void setPathToSource(const QString &path);

    private:
47
        Delta(const QString &targetName, const QByteArray &versionFrom, const QByteArray &versionTo);
Dario Freddi's avatar
Dario Freddi committed
48

49
        DeltaPrivate* const d_ptr;
Dario Freddi's avatar
Dario Freddi committed
50

51
        friend class Backend;
Dario Freddi's avatar
Dario Freddi committed
52 53 54 55 56 57 58
        friend class Database;
        friend class DatabasePrivate;
};

}

#endif // AKABEI_AKABEIDELTA_H