From 2fd65468b3cb25c725a709f9b470ced0ab4823a6 Mon Sep 17 00:00:00 2001 From: Arch Librarian Date: Mon, 20 Sep 2004 16:54:11 +0000 Subject: Fixed handling of missing files Author: jgg Date: 1999-07-04 23:22:53 GMT Fixed handling of missing files --- test/scratch.cc | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 53 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/scratch.cc b/test/scratch.cc index d3ca58a77..c48f3f594 100644 --- a/test/scratch.cc +++ b/test/scratch.cc @@ -1,11 +1,63 @@ +#include +/*void basic_string,alloc>::Rep::release() +{ + cout << "Release " << (void *)this << ' ' << ref << endl; + if (--ref == 0) delete this; +} + +basic_string,alloc>::~basic_string() +{ + cout << "Destroy " << (void *)this << ',' << rep()->ref << endl; + rep ()->release (); +}*/ + + + #include #include +#include +#include +#include +#include + #include #include +#include + +struct Rep +{ + size_t len, res, ref; + bool selfish; +}; int main(int argc,char *argv[]) { + pkgCacheFile Cache; + OpProgress Prog; + pkgInitialize(*_config); + if (Cache.Open(Prog,false) == false) + { + _error->DumpErrors(); + return 0; + } + + pkgRecords rec(*Cache); + while (1) + { + pkgCache::VerIterator V = (*Cache)[Cache->PkgBegin()].CandidateVerIter(*Cache); + pkgRecords::Parser &Parse = rec.Lookup(V.FileList()); + string Foo = Parse.ShortDesc(); + + cout << (reinterpret_cast(Foo.begin()) - 1)[0].ref << endl; + +// cout << Foo << endl; + +// cout << rec.Lookup(V.FileList()).ShortDesc() << endl; + malloc_stats(); + } + +#if 0 URI U(argv[1]); cout << U.Access << endl; cout << U.User << endl; @@ -26,6 +78,6 @@ int main(int argc,char *argv[]) Sect.FindS("Version"); Sect.FindI("Size"); };*/ - +#endif return 0; } -- cgit v1.2.3