]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/acquire-item.h
add Debug::acquire::progress debug option and fixme for index file loading with the...
[apt.git] / apt-pkg / acquire-item.h
index 5a1c7979ccc5fed3bac11822050b6a791d9c7f25..bf5cb09c81c2715d2dd5a07eb346060a6585f391 100644 (file)
 #include <apt-pkg/hashes.h>
 #include <apt-pkg/weakptr.h>
 #include <apt-pkg/pkgcache.h>
+#include <apt-pkg/cacheiterators.h>
+
+#include <string>
+#include <vector>
 
 #ifndef APT_8_CLEANER_HEADERS
 #include <apt-pkg/indexfile.h>
@@ -64,7 +68,7 @@ class pkgAcquire::Item : public WeakPointable
 
    /** \brief Insert this item into its owner's queue.
     *
-    *  \param ItemDesc Metadata about this item (its URI and
+    *  \param Item Metadata about this item (its URI and
     *  description).
     */
    inline void QueueURI(ItemDesc &Item)
@@ -79,7 +83,7 @@ class pkgAcquire::Item : public WeakPointable
     *
     *  \param From The file to be renamed.
     *
-    *  \param To The new name of #From.  If #To exists it will be
+    *  \param To The new name of \a From.  If \a To exists it will be
     *  overwritten.
     */
    void Rename(std::string From,std::string To);
@@ -115,7 +119,7 @@ class pkgAcquire::Item : public WeakPointable
      } Status;
 
    /** \brief Contains a textual description of the error encountered
-    *  if #Status is #StatError or #StatAuthError.
+    *  if #ItemState is #StatError or #StatAuthError.
     */
    std::string ErrorText;
 
@@ -162,6 +166,16 @@ class pkgAcquire::Item : public WeakPointable
     *  \sa pkgAcquire
     */
    unsigned int QueueCounter;
+
+   /** \brief The number of additional fetch items that are expected
+    *  once this item is done.
+    *
+    *  Some items like pkgAcqMeta{Index,Sig} will queue additional
+    *  items. This variable can be set by the methods if it knows
+    *  in advance how many items to expect to get a more accurate
+    *  progress.
+    */
+   unsigned int ExpectedAdditionalItems;
    
    /** \brief The name of the file into which the retrieved object
     *  will be written.
@@ -293,7 +307,6 @@ class pkgAcquire::Item : public WeakPointable
    /** \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);
 };
@@ -636,7 +649,7 @@ class pkgAcqIndexDiffs : public pkgAcquire::Item
    /** \brief Create an index diff item.
     *
     *  After filling in its basic fields, this invokes Finish(true) if
-    *  #diffs is empty, or QueueNextDiff() otherwise.
+    *  \a diffs is empty, or QueueNextDiff() otherwise.
     *
     *  \param Owner The pkgAcquire object that owns this item.
     *
@@ -651,6 +664,8 @@ class pkgAcqIndexDiffs : public pkgAcquire::Item
     *  reconstructed package index file; the index file will be tested
     *  against this value when it is entirely reconstructed.
     *
+    *  \param ServerSha1 is the sha1sum of the current file on the server
+    *
     *  \param diffs The remaining diffs from the index of diffs.  They
     *  should be ordered so that each diff appears before any diff
     *  that depends on it.
@@ -741,7 +756,7 @@ class pkgAcqIndex : public pkgAcquire::Item
               std::string ShortDesc, HashString ExpectedHash, 
               std::string compressExt="");
    pkgAcqIndex(pkgAcquire *Owner, struct IndexTarget const * const Target,
-                        HashString const &ExpectedHash, indexRecords const *MetaIndexParser);
+                        HashString const &ExpectedHash, indexRecords *MetaIndexParser);
    void Init(std::string const &URI, std::string const &URIDesc, std::string const &ShortDesc);
 };
                                                                        /*}}}*/
@@ -773,7 +788,7 @@ class pkgAcqIndexTrans : public pkgAcqIndex
    pkgAcqIndexTrans(pkgAcquire *Owner,std::string URI,std::string URIDesc,
                    std::string ShortDesc);
    pkgAcqIndexTrans(pkgAcquire *Owner, struct IndexTarget const * const Target,
-                   HashString const &ExpectedHash, indexRecords const *MetaIndexParser);
+                   HashString const &ExpectedHash, indexRecords *MetaIndexParser);
 };
                                                                        /*}}}*/
 /** \brief Information about an index file. */                         /*{{{*/
@@ -1162,8 +1177,8 @@ class pkgAcqFile : public pkgAcquire::Item
     *  \param IsIndexFile The file is considered a IndexFile and cache-control
     *                     headers like "cache-control: max-age=0" are send
     *
-    * If DestFilename is empty, download to DestDir/<basename> if
-    * DestDir is non-empty, $CWD/<basename> otherwise.  If
+    * If DestFilename is empty, download to DestDir/\<basename\> if
+    * DestDir is non-empty, $CWD/\<basename\> otherwise.  If
     * DestFilename is NOT empty, DestDir is ignored and DestFilename
     * is the absolute name to which the file should be downloaded.
     */