]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/acquire-item.h
move pty magic into its own functions
[apt.git] / apt-pkg / acquire-item.h
index 27b8e887bba7a4d4440930321a7546a53675227b..6b4f737089fa240c73ed0008a6a71606324c8512 100644 (file)
 #include <apt-pkg/weakptr.h>
 #include <apt-pkg/pkgcache.h>
 
+#ifndef APT_8_CLEANER_HEADERS
+#include <apt-pkg/indexfile.h>
+#include <apt-pkg/vendor.h>
+#include <apt-pkg/sourcelist.h>
+#include <apt-pkg/pkgrecords.h>
+#include <apt-pkg/indexrecords.h>
+#endif
+
 /** \addtogroup acquire
  *  @{
  *
@@ -75,7 +83,7 @@ class pkgAcquire::Item : public WeakPointable
     *  overwritten.
     */
    void Rename(std::string From,std::string To);
-   
+
    public:
 
    /** \brief The current status of this item. */
@@ -273,6 +281,21 @@ class pkgAcquire::Item : public WeakPointable
     *  pkgAcquire::Remove.
     */
    virtual ~Item();
+
+   protected:
+
+   enum RenameOnErrorState {
+      HashSumMismatch,
+      SizeMismatch,
+      InvalidFormat
+   };
+
+   /** \brief Rename failed file and set error
+    *
+    * \param state respresenting the error we encountered
+    * \param errorMsg a message describing the error
+    */
+   bool RenameOnError(RenameOnErrorState const state);
 };
                                                                        /*}}}*/
 /** \brief Information about an index patch (aka diff). */             /*{{{*/
@@ -766,6 +789,7 @@ class pkgAcqMetaSig : public pkgAcquire::Item
                 std::string MetaIndexURI, std::string MetaIndexURIDesc, std::string MetaIndexShortDesc,
                 const std::vector<struct IndexTarget*>* IndexTargets,
                 indexRecords* MetaIndexParser);
+   virtual ~pkgAcqMetaSig();
 };
                                                                        /*}}}*/
 /** \brief An item that is responsible for downloading the meta-index  {{{
@@ -896,6 +920,7 @@ public:
                std::string const &MetaSigURI, std::string const &MetaSigURIDesc, std::string const &MetaSigShortDesc,
                const std::vector<struct IndexTarget*>* IndexTargets,
                indexRecords* MetaIndexParser);
+   virtual ~pkgAcqMetaClearSig();
 };
                                                                        /*}}}*/
 /** \brief An item that is responsible for fetching a package file.    {{{
@@ -972,7 +997,7 @@ class pkgAcqArchive : public pkgAcquire::Item
     *
     *  \param Version The package version to download.
     *
-    *  \param StoreFilename A location in which the actual filename of
+    *  \param[out] StoreFilename A location in which the actual filename of
     *  the package should be stored.  It will be set to a guessed
     *  basename in the constructor, and filled in with a fully
     *  qualified filename once the download finishes.