X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/b84fa7158d04f8b2136f01dda106ba0272027887..3b4d8136e78b9f2a70431ece4c850861d90e8bb1:/apt-pkg/srcrecords.cc diff --git a/apt-pkg/srcrecords.cc b/apt-pkg/srcrecords.cc index 5e40ae624..d63d2c422 100644 --- a/apt-pkg/srcrecords.cc +++ b/apt-pkg/srcrecords.cc @@ -11,24 +11,27 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ +#include + #include #include #include #include - -#include +#include + +#include /*}}}*/ // SrcRecords::pkgSrcRecords - Constructor /*{{{*/ // --------------------------------------------------------------------- /* Open all the source index files */ -pkgSrcRecords::pkgSrcRecords(pkgSourceList &List) : Files(0), Current(0) +pkgSrcRecords::pkgSrcRecords(pkgSourceList &List) : d(NULL), Files(0), Current(0) { - for (pkgSourceList::const_iterator I = List.begin(); I != List.end(); I++) + for (pkgSourceList::const_iterator I = List.begin(); I != List.end(); ++I) { - vector *Indexes = (*I)->GetIndexFiles(); - for (vector::const_iterator J = Indexes->begin(); - J != Indexes->end(); J++) + std::vector *Indexes = (*I)->GetIndexFiles(); + for (std::vector::const_iterator J = Indexes->begin(); + J != Indexes->end(); ++J) { Parser* P = (*J)->CreateSrcParser(); if (_error->PendingError() == true) @@ -55,7 +58,7 @@ pkgSrcRecords::pkgSrcRecords(pkgSourceList &List) : Files(0), Current(0) pkgSrcRecords::~pkgSrcRecords() { // Blow away all the parser objects - for(vector::iterator I = Files.begin(); I != Files.end(); ++I) + for(std::vector::iterator I = Files.begin(); I != Files.end(); ++I) delete *I; } /*}}}*/ @@ -65,8 +68,8 @@ pkgSrcRecords::~pkgSrcRecords() bool pkgSrcRecords::Restart() { Current = Files.begin(); - for (vector::iterator I = Files.begin(); - I != Files.end(); I++) + for (std::vector::iterator I = Files.begin(); + I != Files.end(); ++I) (*I)->Restart(); return true; @@ -77,7 +80,7 @@ bool pkgSrcRecords::Restart() /* This searches on both source package names and output binary names and returns the first found. A 'cursor' like system is used to allow this function to be called multiple times to get successive entries */ -pkgSrcRecords::Parser *pkgSrcRecords::Find(const char *Package,bool SrcOnly) +pkgSrcRecords::Parser *pkgSrcRecords::Find(const char *Package,bool const &SrcOnly) { if (Current == Files.end()) return 0; @@ -89,7 +92,7 @@ pkgSrcRecords::Parser *pkgSrcRecords::Find(const char *Package,bool SrcOnly) { if (_error->PendingError() == true) return 0; - Current++; + ++Current; if (Current == Files.end()) return 0; } @@ -107,7 +110,7 @@ pkgSrcRecords::Parser *pkgSrcRecords::Find(const char *Package,bool SrcOnly) // Check for a binary hit const char **I = (*Current)->Binaries(); - for (; I != 0 && *I != 0; I++) + for (; I != 0 && *I != 0; ++I) if (strcmp(Package,*I) == 0) return *Current; } @@ -116,7 +119,7 @@ pkgSrcRecords::Parser *pkgSrcRecords::Find(const char *Package,bool SrcOnly) // Parser::BuildDepType - Convert a build dep to a string /*{{{*/ // --------------------------------------------------------------------- /* */ -const char *pkgSrcRecords::Parser::BuildDepType(unsigned char Type) +const char *pkgSrcRecords::Parser::BuildDepType(unsigned char const &Type) { const char *fields[] = {"Build-Depends", "Build-Depends-Indep",