akabeidelta.h 3.11 KB
 Dario Freddi committed Mar 18, 2010 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 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 `````` Lukas Appelhans committed Feb 26, 2011 15 ``````#include `````` Dario Freddi committed Mar 18, 2010 16 17 18 19 `````` namespace Akabei { class DeltaPrivate; `````` Lukas Appelhans committed Jun 12, 2011 20 21 22 23 24 25 26 27 28 29 30 31 32 `````` /** * \class Delta Akabei/Delta * * \brief This class describes a binary patch we use to upgrade from one package version to another. * * Akabei Deltas can either be loaded from the \c Database or from a local file (\c Backend). If both the * path to the .delta.tar.xz-file and the original package are set, it's just a matter of running the command * generated by \c xdeltaApplyCommand. * @see setPathToDelta() * @see setPathToSource() * @see xdeltaApplyCommand */ `````` Dario Freddi committed Mar 18, 2010 33 34 35 36 37 38 ``````class Delta { Q_DISABLE_COPY(Delta) Q_DECLARE_PRIVATE(Delta) public: virtual ~Delta(); `````` Lukas Appelhans committed Jun 12, 2011 39 40 41 `````` /** * @returns the correct md5sum of the delta */ `````` Dario Freddi committed Mar 18, 2010 42 43 `````` QByteArray md5sum() const; `````` Lukas Appelhans committed Jun 12, 2011 44 45 46 `````` /** * @returns the name of the package the delta needs to be applied on */ `````` Dario Freddi committed Mar 18, 2010 47 `````` QString targetName() const; `````` Lukas Appelhans committed Jun 12, 2011 48 49 50 `````` /** * @returns the version of the package which the delta needs to be applied on */ `````` Dario Freddi committed Mar 19, 2010 51 `````` QByteArray versionFrom() const; `````` Lukas Appelhans committed Jun 12, 2011 52 53 54 55 `````` /** * @returns the version of the package which is generated after the delta got applied to * a package with \c versionFrom */ `````` Dario Freddi committed Mar 19, 2010 56 `````` QByteArray versionTo() const; `````` Dario Freddi committed Mar 18, 2010 57 `````` `````` Lukas Appelhans committed Jun 12, 2011 58 59 60 `````` /** * @returns the filename of the .delta.tar.xz-file on disk */ `````` Dario Freddi committed Mar 18, 2010 61 62 `````` QString filename() const; `````` Lukas Appelhans committed Jun 12, 2011 63 64 65 66 `````` /** * Checks whether the md5sum given in the .DELTAINFO and the real md5sum match * @returns true when both match */ `````` Dario Freddi committed Mar 18, 2010 67 68 `````` bool checkMD5Sum(); `````` Lukas Appelhans committed Jun 12, 2011 69 70 71 72 `````` /** * @returns the command used for generating the package with version \c versionTo * @param pathToDestination the path to the package with \c versionTo, not existent at this point */ `````` Dario Freddi committed Mar 18, 2010 73 74 `````` QString xdeltaApplyCommand(const QString &pathToDestination) const; `````` Lukas Appelhans committed Jun 12, 2011 75 76 77 `````` /** * @returns the path to the .delta.tar.xz-file */ `````` Dario Freddi committed Mar 18, 2010 78 `````` QString pathToDelta() const; `````` Lukas Appelhans committed Jun 12, 2011 79 80 81 82 `````` /** * Set the path to the .delta.tar.xz-file * @param path the path of the file */ `````` Dario Freddi committed Mar 18, 2010 83 84 `````` void setPathToDelta(const QString &path); `````` Lukas Appelhans committed Jun 12, 2011 85 86 87 `````` /** * @returns the path to the package with version \c versionFrom */ `````` Dario Freddi committed Mar 18, 2010 88 `````` QString pathToSource() const; `````` Lukas Appelhans committed Jun 12, 2011 89 90 91 92 `````` /** * Sets the path to the package with version \c versionFrom * @param path the path to the package */ `````` Dario Freddi committed Mar 18, 2010 93 94 95 `````` void setPathToSource(const QString &path); private: `````` Dario Freddi committed Mar 19, 2010 96 `````` Delta(const QString &targetName, const QByteArray &versionFrom, const QByteArray &versionTo); `````` Dario Freddi committed Mar 18, 2010 97 `````` `````` Lukas Appelhans committed Feb 26, 2011 98 `````` DeltaPrivate * const d_ptr; `````` Dario Freddi committed Mar 18, 2010 99 `````` `````` Dario Freddi committed Mar 19, 2010 100 `````` friend class Backend; `````` Dario Freddi committed Mar 18, 2010 101 102 103 104 105 106 107 `````` friend class Database; friend class DatabasePrivate; }; } #endif // AKABEI_AKABEIDELTA_H``````