summaryrefslogtreecommitdiff
path: root/apt-pkg/acquire.cc
blob: 9d8ae99345b1cada195b7eac6204b190b8620061 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
// -*- mode: cpp; mode: fold -*-
// Description								/*{{{*/
// $Id: acquire.cc,v 1.1 1998/10/15 06:59:59 jgg Exp $
/* ######################################################################

   Acquire - File Acquiration

   ##################################################################### */
									/*}}}*/
// Include Files							/*{{{*/
#ifdef __GNUG__
#pragma implementation "apt-pkg/acquire.h"
#endif       
#include <apt-pkg/acquire.h>
#include <apt-pkg/acquire-item.h>
#include <apt-pkg/acquire-worker.h>
									/*}}}*/

// Acquire::pkgAcquire - Constructor					/*{{{*/
// ---------------------------------------------------------------------
/* */
pkgAcquire::pkgAcquire()
{
   Queues = 0;
   Configs = 0;
}
									/*}}}*/
// Acquire::~pkgAcquire	- Destructor					/*{{{*/
// ---------------------------------------------------------------------
/* */
pkgAcquire::~pkgAcquire()
{
   while (Items.size() != 0)
      delete Items[0];
}
									/*}}}*/
// Acquire::Add - Add a new item					/*{{{*/
// ---------------------------------------------------------------------
/* */
void pkgAcquire::Add(Item *Itm)
{
   Items.push_back(Itm);
}
									/*}}}*/
// Acquire::Remove - Remove a item					/*{{{*/
// ---------------------------------------------------------------------
/* */
void pkgAcquire::Remove(Item *Itm)
{
   for (vector<Item *>::iterator I = Items.begin(); I < Items.end(); I++)
   {
      if (*I == Itm)
	 Items.erase(I);
   }   
}
									/*}}}*/
// Acquire::Enqueue - Queue an URI for fetching				/*{{{*/
// ---------------------------------------------------------------------
/* */
void pkgAcquire::Enqueue(Item *Item,string URI)
{
   cout << "Fetching " << URI << endl;
   cout << "   to " << Item->ToFile() << endl;
}
									/*}}}*/