[Debtags-commits] [svn] r1828 - in debtags/1.6.0: . tools

Enrico Zini enrico at costa.debian.org
Sun Jul 9 07:54:03 UTC 2006


Author: enrico
Date: Sun Jul  9 07:54:01 2006
New Revision: 1828

Modified:
   debtags/1.6.0/   (props changed)
   debtags/1.6.0/tools/debtags.cc
Log:
 r3016 at viaza:  enrico | 2006-07-09 09:35:36 +0200
 Successfully forked Ept


Modified: debtags/1.6.0/tools/debtags.cc
==============================================================================
--- debtags/1.6.0/tools/debtags.cc	(original)
+++ debtags/1.6.0/tools/debtags.cc	Sun Jul  9 07:54:01 2006
@@ -27,19 +27,6 @@
 #define PACKAGE_VERSION "unknown"
 #endif
 
-#include <ept/init.h>
-#include <ept/forward.h>
-//#include <ept/cache/cache.h>
-#include <ept/cache/debtags/serializer.h>
-#include <ept/cache/debtags/vocabulary.h>
-#include <ept/cache/debtags/tagmap.h>
-#include <ept/cache/debtags/update.h>
-#include <ept/cache/tag.h>
-#include <ept/cache/package.h>
-#include <ept/cache/version.h>
-//#include <ept/predicate/factory.h>
-//#include <ept/predicate/predicate.h>
-
 #include <tagcoll/input/stdio.h>
 #include <tagcoll/stream/filters.h>
 #include <tagcoll/expression.h>
@@ -54,6 +41,8 @@
 #include "acqprogress.h"
 #include "Printer.h"
 #include "nullstream.h"
+#include "Ept.h"
+
 
 #include <apt-pkg/configuration.h>
 
@@ -63,6 +52,7 @@
 #include <sys/types.h>	// umask
 #include <sys/stat.h>	// umask
 
+
 namespace std {
 
 template<typename TAG, typename _Traits>
@@ -93,68 +83,6 @@
 }
 
 using namespace std;
-using namespace ept::configuration;
-using namespace tagcoll;
-
-typedef apt::cache::Package Package;
-typedef apt::cache::Tag Tag;
-typedef apt::cache::Facet Facet;
-typedef apt::cache::Packages Packages;
-typedef apt::cache::Version Version;
-typedef apt::cache::Vocabulary Vocabulary;
-typedef apt::cache::TagMap TagMap;
-
-class Ept
-{
-	struct antani {
-		antani()
-		{
-			ept::init();
-		}
-	} call_ept_init;
-
-	Vocabulary m_vocabulary;
-	Packages m_packages;
-	TagMap m_tagmap;
-
-public:
-	Ept(bool editable = false) :
-		m_tagmap(m_vocabulary, m_packages, editable) {}
-
-	Packages& packages() { return m_packages; }
-	TagMap& tagmap() { return m_tagmap; }
-	Vocabulary& vocabulary() { return m_vocabulary; }
-
-	template<typename OUT>
-	void readCollection(const string& file, const OUT& out)
-	{
-		if (file == "-")
-		{
-			input::Stdio input(stdin, "<stdin>");
-			textformat::parse(input, ept::t::cache::debtags::stringToEpt<ept::configuration::Apt>(m_packages, m_vocabulary, out));
-		}
-		else
-		{
-			input::Stdio input(file);
-			textformat::parse(input, ept::t::cache::debtags::stringToEpt<ept::configuration::Apt>(m_packages, m_vocabulary, out));
-		}
-	}
-
-	template<typename OUT>
-	void readCollectionRaw(const string& file, const OUT& out)
-	{
-		if (file == "-")
-		{
-			input::Stdio input(stdin, "<stdin>");
-			textformat::parse(input, out);
-		}
-		else
-		{
-			input::Stdio input(file);
-			textformat::parse(input, out);
-		}
-	}
-};
 
 template<typename OUT>
 class ExpressionFilter : public wibble::mixin::OutputIterator< ExpressionFilter<OUT> >
@@ -2455,5 +2383,6 @@
 #include <ept/cache/apt/packages.tcc>
 #include <ept/cache/debtags/tagmap.tcc>
 #include <tagcoll/coll/fast.tcc>
+#include "Ept.tcc"
 
 // vim:set ts=4 sw=4:



More information about the Debtags-commits mailing list