]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/acquire.h
pkgAcqArchive::QueueNext(): change owner/permission of DestFile
[apt.git] / apt-pkg / acquire.h
index 93772403d5c37e8b369698d3ef05e726636fd261..f9eeb1641af318f9c36a7783ea849ec01d5d8b49 100644 (file)
 #include <vector>
 #include <string>
 
 #include <vector>
 #include <string>
 
+#include <stddef.h>
 #include <sys/time.h>
 #include <sys/time.h>
+#include <sys/select.h>
+
+#ifndef APT_10_CLEANER_HEADERS
 #include <unistd.h>
 #include <unistd.h>
+#endif
+
+#ifndef APT_8_CLEANER_HEADERS
+using std::vector;
+using std::string;
+#endif
 
 class pkgAcquireStatus;
 
 
 class pkgAcquireStatus;
 
@@ -277,18 +287,18 @@ class pkgAcquire
     */
    void Shutdown();
    
     */
    void Shutdown();
    
-   /** \brief Get the first #Worker object.
+   /** \brief Get the first Worker object.
     *
     *  \return the first active worker in this download process.
     */
    inline Worker *WorkersBegin() {return Workers;};
 
     *
     *  \return the first active worker in this download process.
     */
    inline Worker *WorkersBegin() {return Workers;};
 
-   /** \brief Advance to the next #Worker object.
+   /** \brief Advance to the next Worker object.
     *
     *  \return the worker immediately following I, or \b NULL if none
     *  exists.
     */
     *
     *  \return the worker immediately following I, or \b NULL if none
     *  exists.
     */
-   Worker *WorkerStep(Worker *I);
+   Worker *WorkerStep(Worker *I) APT_PURE;
 
    /** \brief Get the head of the list of items. */
    inline ItemIterator ItemsBegin() {return Items.begin();};
 
    /** \brief Get the head of the list of items. */
    inline ItemIterator ItemsBegin() {return Items.begin();};
@@ -341,14 +351,24 @@ class pkgAcquire
     *  long as the pkgAcquire object does.
     *  \param Lock defines a lock file that should be acquired to ensure
     *  only one Acquire class is in action at the time or an empty string
     *  long as the pkgAcquire object does.
     *  \param Lock defines a lock file that should be acquired to ensure
     *  only one Acquire class is in action at the time or an empty string
-    *  if no lock file should be used.
+    *  if no lock file should be used. If set also all needed directories
+    *  will be created.
     */
     */
-   bool Setup(pkgAcquireStatus *Progress = NULL, std::string const &Lock = "");
+   APT_DEPRECATED bool Setup(pkgAcquireStatus *Progress = NULL, std::string const &Lock = "");
 
    void SetLog(pkgAcquireStatus *Progress) { Log = Progress; }
 
 
    void SetLog(pkgAcquireStatus *Progress) { Log = Progress; }
 
+   /** \brief acquire lock and perform directory setup
+    *
+    *  \param Lock defines a lock file that should be acquired to ensure
+    *  only one Acquire class is in action at the time or an empty string
+    *  if no lock file should be used. If set also all needed directories
+    *  will be created and setup.
+    */
+   bool GetLock(std::string const &Lock);
+
    /** \brief Construct a new pkgAcquire. */
    /** \brief Construct a new pkgAcquire. */
-   pkgAcquire(pkgAcquireStatus *Log) __deprecated;
+   pkgAcquire(pkgAcquireStatus *Log);
    pkgAcquire();
 
    /** \brief Destroy this pkgAcquire object.
    pkgAcquire();
 
    /** \brief Destroy this pkgAcquire object.
@@ -471,7 +491,7 @@ class pkgAcquire::Queue
     *  \return the first item in the queue whose URI is #URI and that
     *  is being downloaded by #Owner.
     */
     *  \return the first item in the queue whose URI is #URI and that
     *  is being downloaded by #Owner.
     */
-   QItem *FindItem(std::string URI,pkgAcquire::Worker *Owner);
+   QItem *FindItem(std::string URI,pkgAcquire::Worker *Owner) APT_PURE;
 
    /** Presumably this should start downloading an item?
     *
 
    /** Presumably this should start downloading an item?
     *
@@ -575,7 +595,7 @@ class pkgAcquire::UriIterator
     *
     *  \param Q The queue over which this UriIterator should iterate.
     */
     *
     *  \param Q The queue over which this UriIterator should iterate.
     */
-   UriIterator(pkgAcquire::Queue *Q) : CurQ(Q), CurItem(0)
+   UriIterator(pkgAcquire::Queue *Q) : d(NULL), CurQ(Q), CurItem(0)
    {
       while (CurItem == 0 && CurQ != 0)
       {
    {
       while (CurItem == 0 && CurQ != 0)
       {
@@ -704,6 +724,10 @@ class pkgAcquireStatus
    /** \brief The number of items that have been successfully downloaded. */
    unsigned long CurrentItems;
    
    /** \brief The number of items that have been successfully downloaded. */
    unsigned long CurrentItems;
    
+   /** \brief The estimated percentage of the download (0-100)
+    */
+   double Percent;
+
    public:
 
    /** \brief If \b true, the download scheduler should call Pulse()
    public:
 
    /** \brief If \b true, the download scheduler should call Pulse()