Author: enrico
Date: Mon Aug 14 15:14:00 2006
New Revision: 1841
Modified:
debtags/1.6.0/ (props changed)
debtags/1.6.0/tools/Ept.h
debtags/1.6.0/tools/Ept.tcc
debtags/1.6.0/tools/SmartSearcher.cc
debtags/1.6.0/tools/debtags.cc
Log:
r3141 at viaza: enrico | 2006-08-14 16:05:14 +0100
Ported most to new libept (still not finished)
Modified: debtags/1.6.0/tools/Ept.h
==============================================================================
--- debtags/1.6.0/tools/Ept.h (original)
+++ debtags/1.6.0/tools/Ept.h Mon Aug 14 15:14:00 2006
@@ -23,6 +23,7 @@
#include <ept/init.h>
#include <ept/forward.h>
+#include <ept/configuration/apt.h>
//#include <ept/cache/cache.h>
#include <ept/cache/debtags/serializer.h>
#include <ept/cache/debtags/vocabulary.h>
@@ -38,6 +39,7 @@
using namespace ept::configuration;
using namespace tagcoll;
+typedef apt::cache::Aggregator Aggregator;
typedef apt::cache::Package Package;
typedef apt::cache::Tag Tag;
typedef apt::cache::Facet Facet;
@@ -45,6 +47,7 @@
typedef apt::cache::Version Version;
typedef apt::cache::Vocabulary Vocabulary;
typedef apt::cache::TagMap TagMap;
+typedef apt::cache::Index Index;
class Ept
@@ -56,17 +59,14 @@
}
} call_ept_init;
- Vocabulary m_vocabulary;
- Packages m_packages;
- TagMap m_tagmap;
+ Aggregator agg;
public:
- Ept(bool editable = false) :
- m_tagmap(m_vocabulary, m_packages, editable) {}
+ Ept(bool editable = false) {}
- Packages& packages() { return m_packages; }
- TagMap& tagmap() { return m_tagmap; }
- Vocabulary& vocabulary() { return m_vocabulary; }
+ Index& packages() { return agg.index(); }
+ TagMap& tagmap() { return agg.tagMap(); }
+ Vocabulary& vocabulary() { return agg.vocabulary(); }
template<typename OUT>
void readCollection(const string& file, const OUT& out);
Modified: debtags/1.6.0/tools/Ept.tcc
==============================================================================
--- debtags/1.6.0/tools/Ept.tcc (original)
+++ debtags/1.6.0/tools/Ept.tcc Mon Aug 14 15:14:00 2006
@@ -30,12 +30,12 @@
if (file == "-")
{
input::Stdio input(stdin, "<stdin>");
- textformat::parse(input, ept::t::cache::debtags::stringToEpt<ept::configuration::Apt>(m_packages, m_vocabulary, out));
+ textformat::parse(input, ept::t::cache::debtags::stringToEpt<ept::configuration::Apt>(this->packages(), this->vocabulary(), out));
}
else
{
input::Stdio input(file);
- textformat::parse(input, ept::t::cache::debtags::stringToEpt<ept::configuration::Apt>(m_packages, m_vocabulary, out));
+ textformat::parse(input, ept::t::cache::debtags::stringToEpt<ept::configuration::Apt>(this->packages(), this->vocabulary(), out));
}
}
Modified: debtags/1.6.0/tools/SmartSearcher.cc
==============================================================================
--- debtags/1.6.0/tools/SmartSearcher.cc (original)
+++ debtags/1.6.0/tools/SmartSearcher.cc Mon Aug 14 15:14:00 2006
@@ -172,7 +172,7 @@
SmartSearcher::SmartSearcher(Ept& ept, const std::string& pattern) : ept(ept)
{
// Perform the initial filtering using the keyword search
- for (Packages::iterator i = ept.packages().begin();
+ for (Index::iterator i = ept.packages().begin();
i != ept.packages().end(); ++i)
fullColl.insert(wibble::singleton(*i), ept.tagmap().getTagsOfItem(*i));
Modified: debtags/1.6.0/tools/debtags.cc
==============================================================================
--- debtags/1.6.0/tools/debtags.cc (original)
+++ debtags/1.6.0/tools/debtags.cc Mon Aug 14 15:14:00 2006
@@ -971,7 +971,7 @@
{
auto_ptr<Ept> ept = debtagsInit();
Vocabulary& voc = ept->vocabulary();
- Packages& pkgs = ept->packages();
+ Index& pkgs = ept->packages();
// ensure that all facets are readable
std::set<Facet> facets = voc.facets();
@@ -996,7 +996,7 @@
}
// ensure that all packages that declare they are readable, are readable
- for (Packages::iterator i = pkgs.begin(); i != pkgs.end(); ++i)
+ for (Index::iterator i = pkgs.begin(); i != pkgs.end(); ++i)
{
cout << "Checking package " << i->name(string("(invalid)")) << "..." << endl;
if (i->valid())
@@ -1462,7 +1462,7 @@
auto_ptr<Ept> ept = debtagsInit();
wantTagDatabase();
- int pkgCount = ept->packages().index().packageCount();
+ int pkgCount = ept->packages().packageCount();
printf("Total count of packages: %d\n", pkgCount);
Stats stats;