// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: sourcelist.cc,v 1.21 2002/03/20 05:51:20 jgg Exp $
+// $Id: sourcelist.cc,v 1.23 2002/07/01 21:41:11 jgg Exp $
/* ######################################################################
List of Sources
#include <apti18n.h>
-#include <fstream.h>
+#include <fstream>
/*}}}*/
using namespace std;
Read(File);
}
/*}}}*/
+// SourceList::~pkgSourceList - Destructor /*{{{*/
+// ---------------------------------------------------------------------
+/* */
+pkgSourceList::~pkgSourceList()
+{
+ for (const_iterator I = SrcList.begin(); I != SrcList.end(); I++)
+ delete *I;
+ for (vector<Vendor const *>::const_iterator I = VendorList.begin();
+ I != VendorList.end(); I++)
+ delete *I;
+}
+ /*}}}*/
// SourceList::ReadVendors - Read list of known package vendors /*{{{*/
// ---------------------------------------------------------------------
/* This also scans a directory of vendor files similar to apt.conf.d
if (ReadConfigFile(Cnf,CnfFile,true) == false)
return false;
+ for (vector<Vendor const *>::const_iterator I = VendorList.begin();
+ I != VendorList.end(); I++)
+ delete *I;
+ VendorList.erase(VendorList.begin(),VendorList.end());
+
// Process 'simple-key' type sections
const Configuration::Item *Top = Cnf.Tree("simple-key");
for (Top = (Top == 0?0:Top->Child); Top != 0; Top = Top->Next)
if (!F != 0)
return _error->Errno("ifstream::ifstream",_("Opening %s"),File.c_str());
+ for (const_iterator I = SrcList.begin(); I != SrcList.end(); I++)
+ delete *I;
SrcList.erase(SrcList.begin(),SrcList.end());
char Buffer[300];