projects
/
apt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
remove the Section member from package struct
[apt.git]
/
apt-pkg
/
acquire.h
diff --git
a/apt-pkg/acquire.h
b/apt-pkg/acquire.h
index 7db7a99586ddb714756afd3ec83298a598bc5a41..0113021b21dce95c1a4cec534a61732c2e75d5c8 100644
(file)
--- a/
apt-pkg/acquire.h
+++ b/
apt-pkg/acquire.h
@@
-72,12
+72,18
@@
#include <vector>
#include <string>
#include <vector>
#include <string>
-using std::vector;
-using std::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;
@@
-107,8
+113,8
@@
class pkgAcquire
friend class Item;
friend class Queue;
friend class Item;
friend class Queue;
- typedef vector<Item *>::iterator ItemIterator;
- typedef vector<Item *>::const_iterator ItemCIterator;
+ typedef
std::
vector<Item *>::iterator ItemIterator;
+ typedef
std::
vector<Item *>::const_iterator ItemCIterator;
protected:
protected:
@@
-117,7
+123,7
@@
class pkgAcquire
* This is built monotonically as items are created and only
* emptied when the download shuts down.
*/
* This is built monotonically as items are created and only
* emptied when the download shuts down.
*/
- vector<Item *> Items;
+
std::
vector<Item *> Items;
/** \brief The head of the list of active queues.
*
/** \brief The head of the list of active queues.
*
@@
-148,12
+154,7
@@
class pkgAcquire
/** \brief The progress indicator for this download. */
pkgAcquireStatus *Log;
/** \brief The progress indicator for this download. */
pkgAcquireStatus *Log;
- /** \brief The total size of the files which are to be fetched.
- *
- * This is not necessarily the total number of bytes to download
- * when, e.g., download resumption and list updates via patches
- * are taken into account.
- */
+ /** \brief The number of files which are to be fetched. */
unsigned long ToFetch;
// Configurable parameters for the scheduler
unsigned long ToFetch;
// Configurable parameters for the scheduler
@@
-207,7
+208,7
@@
class pkgAcquire
* \return the string-name of the queue in which a fetch request
* for the given URI should be placed.
*/
* \return the string-name of the queue in which a fetch request
* for the given URI should be placed.
*/
- st
ring QueueName(
string URI,MethodConfig const *&Config);
+ st
d::string QueueName(std::
string URI,MethodConfig const *&Config);
/** \brief Build up the set of file descriptors upon which select() should
* block.
/** \brief Build up the set of file descriptors upon which select() should
* block.
@@
-253,7
+254,7
@@
class pkgAcquire
*
* \return the method whose name is Access, or \b NULL if no such method exists.
*/
*
* \return the method whose name is Access, or \b NULL if no such method exists.
*/
- MethodConfig *GetConfig(string Access);
+ MethodConfig *GetConfig(st
d::st
ring Access);
/** \brief Provides information on how a download terminated. */
enum RunResult {
/** \brief Provides information on how a download terminated. */
enum RunResult {
@@
-286,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();};
@@
-324,7
+325,7
@@
class pkgAcquire
*
* \return \b true if the directory exists and is readable.
*/
*
* \return \b true if the directory exists and is readable.
*/
- bool Clean(string Dir);
+ bool Clean(st
d::st
ring Dir);
/** \return the total size in bytes of all the items included in
* this download.
/** \return the total size in bytes of all the items included in
* this download.
@@
-352,10
+353,12
@@
class pkgAcquire
* only one Acquire class is in action at the time or an empty string
* if no lock file should be used.
*/
* only one Acquire class is in action at the time or an empty string
* if no lock file should be used.
*/
- bool Setup(pkgAcquireStatus *Progress = NULL, string const &Lock = "");
+ bool Setup(pkgAcquireStatus *Progress = NULL, std::string const &Lock = "");
+
+ void SetLog(pkgAcquireStatus *Progress) { Log = Progress; }
/** \brief Construct a new pkgAcquire. */
/** \brief Construct a new pkgAcquire. */
- pkgAcquire(pkgAcquireStatus *Log)
__deprecated
;
+ pkgAcquire(pkgAcquireStatus *Log)
APT_DEPRECATED
;
pkgAcquire();
/** \brief Destroy this pkgAcquire object.
pkgAcquire();
/** \brief Destroy this pkgAcquire object.
@@
-375,11
+378,11
@@
class pkgAcquire
struct pkgAcquire::ItemDesc : public WeakPointable
{
/** \brief The URI from which to download this item. */
struct pkgAcquire::ItemDesc : public WeakPointable
{
/** \brief The URI from which to download this item. */
- string URI;
+ st
d::st
ring URI;
/** brief A description of this item. */
/** brief A description of this item. */
- string Description;
+ st
d::st
ring Description;
/** brief A shorter description of this item. */
/** brief A shorter description of this item. */
- string ShortDesc;
+ st
d::st
ring ShortDesc;
/** brief The underlying item which is to be downloaded. */
Item *Owner;
};
/** brief The underlying item which is to be downloaded. */
Item *Owner;
};
@@
-423,7
+426,7
@@
class pkgAcquire::Queue
};
/** \brief The name of this queue. */
};
/** \brief The name of this queue. */
- string Name;
+ st
d::st
ring Name;
/** \brief The head of the list of items contained in this queue.
*
/** \brief The head of the list of items contained in this queue.
*
@@
-478,13
+481,13
@@
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(st
ring URI,pkgAcquire::Worker *Owner)
;
+ QItem *FindItem(st
d::string URI,pkgAcquire::Worker *Owner) APT_PURE
;
/** Presumably this should start downloading an item?
*
* \todo Unimplemented. Implement it or remove?
*/
/** Presumably this should start downloading an item?
*
* \todo Unimplemented. Implement it or remove?
*/
- bool ItemStart(QItem *Itm,unsigned long Size);
+ bool ItemStart(QItem *Itm,unsigned long
long
Size);
/** \brief Remove the given item from this queue and set its state
* to pkgAcquire::Item::StatDone.
/** \brief Remove the given item from this queue and set its state
* to pkgAcquire::Item::StatDone.
@@
-541,7
+544,7
@@
class pkgAcquire::Queue
* \param Name The name of the new queue.
* \param Owner The download process that owns the new queue.
*/
* \param Name The name of the new queue.
* \param Owner The download process that owns the new queue.
*/
- Queue(string Name,pkgAcquire *Owner);
+ Queue(st
d::st
ring Name,pkgAcquire *Owner);
/** Shut down all the worker processes associated with this queue
* and empty the queue.
/** Shut down all the worker processes associated with this queue
* and empty the queue.
@@
-606,10
+609,10
@@
struct pkgAcquire::MethodConfig
MethodConfig *Next;
/** \brief The name of this acquire method (e.g., http). */
MethodConfig *Next;
/** \brief The name of this acquire method (e.g., http). */
- string Access;
+ st
d::st
ring Access;
/** \brief The implementation version of this acquire method. */
/** \brief The implementation version of this acquire method. */
- string Version;
+ st
d::st
ring Version;
/** \brief If \b true, only one download queue should be created for this
* method.
/** \brief If \b true, only one download queue should be created for this
* method.
@@
-655,8
+658,6
@@
struct pkgAcquire::MethodConfig
/** \brief A monitor object for downloads controlled by the pkgAcquire class. {{{
*
* \todo Why protected members?
/** \brief A monitor object for downloads controlled by the pkgAcquire class. {{{
*
* \todo Why protected members?
- *
- * \todo Should the double members be uint64_t?
*/
class pkgAcquireStatus
{
*/
class pkgAcquireStatus
{
@@
-674,34
+675,34
@@
class pkgAcquireStatus
/** \brief The number of bytes fetched as of the previous call to
* pkgAcquireStatus::Pulse, including local items.
*/
/** \brief The number of bytes fetched as of the previous call to
* pkgAcquireStatus::Pulse, including local items.
*/
-
double
LastBytes;
+
unsigned long long
LastBytes;
/** \brief The current rate of download as of the most recent call
* to pkgAcquireStatus::Pulse, in bytes per second.
*/
/** \brief The current rate of download as of the most recent call
* to pkgAcquireStatus::Pulse, in bytes per second.
*/
-
double
CurrentCPS;
+
unsigned long long
CurrentCPS;
/** \brief The number of bytes fetched as of the most recent call
* to pkgAcquireStatus::Pulse, including local items.
*/
/** \brief The number of bytes fetched as of the most recent call
* to pkgAcquireStatus::Pulse, including local items.
*/
-
double
CurrentBytes;
+
unsigned long long
CurrentBytes;
/** \brief The total number of bytes that need to be fetched.
*
* \warning This member is inaccurate, as new items might be
* enqueued while the download is in progress!
*/
/** \brief The total number of bytes that need to be fetched.
*
* \warning This member is inaccurate, as new items might be
* enqueued while the download is in progress!
*/
-
double
TotalBytes;
+
unsigned long long
TotalBytes;
/** \brief The total number of bytes accounted for by items that
* were successfully fetched.
*/
/** \brief The total number of bytes accounted for by items that
* were successfully fetched.
*/
-
double
FetchedBytes;
+
unsigned long long
FetchedBytes;
/** \brief The amount of time that has elapsed since the download
* started.
*/
/** \brief The amount of time that has elapsed since the download
* started.
*/
- unsigned long ElapsedTime;
+ unsigned long
long
ElapsedTime;
/** \brief The total number of items that need to be fetched.
*
/** \brief The total number of items that need to be fetched.
*
@@
-713,6
+714,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()
@@
-734,7
+739,7
@@
class pkgAcquireStatus
*
* \param ResumePoint How much of the file was already fetched.
*/
*
* \param ResumePoint How much of the file was already fetched.
*/
- virtual void Fetched(unsigned long
Size,unsigned
long ResumePoint);
+ virtual void Fetched(unsigned long
long Size,unsigned long
long ResumePoint);
/** \brief Invoked when the user should be prompted to change the
* inserted removable media.
/** \brief Invoked when the user should be prompted to change the
* inserted removable media.
@@
-753,7
+758,7
@@
class pkgAcquireStatus
* \todo This is a horrible blocking monster; it should be CPSed
* with prejudice.
*/
* \todo This is a horrible blocking monster; it should be CPSed
* with prejudice.
*/
- virtual bool MediaChange(st
ring Media,
string Drive) = 0;
+ virtual bool MediaChange(st
d::string Media,std::
string Drive) = 0;
/** \brief Invoked when an item is confirmed to be up-to-date.
/** \brief Invoked when an item is confirmed to be up-to-date.