[Debtags-commits] [svn] r1767 - in tagcoll/2.0: . tagcoll tagcoll/stream tools

Enrico Zini enrico at costa.debian.org
Thu May 11 13:36:16 UTC 2006


Author: enrico
Date: Thu May 11 13:36:14 2006
New Revision: 1767

Added:
   tagcoll/2.0/tagcoll/stream/filters.tcc
Modified:
   tagcoll/2.0/   (props changed)
   tagcoll/2.0/tagcoll/Makefile.am
   tagcoll/2.0/tagcoll/TextFormat.cc
   tagcoll/2.0/tagcoll/stream/filters.cc
   tagcoll/2.0/tagcoll/stream/filters.h
   tagcoll/2.0/tools/tagcoll.cc
Log:
 r2715 at viaza:  enrico | 2006-05-11 07:41:13 -0500
 Split filters.tcc out of filters.h


Modified: tagcoll/2.0/tagcoll/Makefile.am
==============================================================================
--- tagcoll/2.0/tagcoll/Makefile.am	(original)
+++ tagcoll/2.0/tagcoll/Makefile.am	Thu May 11 13:36:14 2006
@@ -20,6 +20,7 @@
 		\
 		stream/sink.h \
 		stream/filters.h \
+		stream/filters.tcc \
 		stream/expression.h \
 		stream/substitutions.h \
 		stream/patcher.h \

Modified: tagcoll/2.0/tagcoll/TextFormat.cc
==============================================================================
--- tagcoll/2.0/tagcoll/TextFormat.cc	(original)
+++ tagcoll/2.0/tagcoll/TextFormat.cc	Thu May 11 13:36:14 2006
@@ -357,6 +357,7 @@
 }
 
 #include <tagcoll/TextFormat.tcc>
+#include <tagcoll/stream/filters.tcc>
 
 #endif
 

Modified: tagcoll/2.0/tagcoll/stream/filters.cc
==============================================================================
--- tagcoll/2.0/tagcoll/stream/filters.cc	(original)
+++ tagcoll/2.0/tagcoll/stream/filters.cc	Thu May 11 13:36:14 2006
@@ -193,6 +193,7 @@
 }
 
 #include <tagcoll/TextFormat.tcc>
+#include <tagcoll/stream/filters.tcc>
 
 #endif
 // vim:set ts=4 sw=4:

Modified: tagcoll/2.0/tagcoll/stream/filters.h
==============================================================================
--- tagcoll/2.0/tagcoll/stream/filters.h	(original)
+++ tagcoll/2.0/tagcoll/stream/filters.h	Thu May 11 13:36:14 2006
@@ -24,10 +24,19 @@
  */
 
 #include <wibble/mixin.h>
-#include <wibble/singleton.h>
-#include <wibble/empty.h>
-#include <set>
-#include <map>
+
+namespace std {
+template<typename A, typename B>
+class pair;
+}
+
+namespace wibble {
+template<typename T>
+class Empty;
+template<typename T>
+class Singleton;
+}
+
 #include <string>
 
 namespace tagcoll {
@@ -105,24 +114,7 @@
 	UntaggedRemover(const OUT& out, bool inverse = false) : out(out), inverse(inverse) {}
 
 	template<typename Items, typename Tags>
-	UntaggedRemover<OUT>& operator=(const std::pair<Items, Tags>& data)
-	{
-		if (data.second.begin() == data.second.end())
-		{
-			if (inverse)
-			{
-				*out = data;
-				++out;
-			}
-		} else {
-			if (!inverse)
-			{
-				*out = data;
-				++out;
-			}
-		}
-		return *this;
-	}
+	UntaggedRemover<OUT>& operator=(const std::pair<Items, Tags>& data);
 };
 
 template<typename OUT>
@@ -147,26 +139,7 @@
 		: out(out), separator(separator) {}
 
 	template<typename Items, typename Tags>
-	UnfacetedRemover<OUT>& operator=(const std::pair<Items, Tags>& data)
-	{
-		std::set<std::string> patched;
-		bool changed = false;
-
-		for (typename Tags::const_iterator i = data.second.begin();
-				i != data.second.end(); ++i)
-			if (i->find(separator) != std::string::npos)
-				patched.insert(*i);
-			else
-				changed = true;
-
-		if (changed)
-			*out = make_pair(data.first, patched);
-		else
-			*out = data;
-		++out;
-
-		return *this;
-	}
+	UnfacetedRemover<OUT>& operator=(const std::pair<Items, Tags>& data);
 };
 
 template<typename OUT>
@@ -209,23 +182,10 @@
 		: out(out), reversedNull(reversedNull) {}
 
 	template<typename ITEMS>
-	Reverser<OUT, TAG>& operator=(const std::pair< ITEMS, wibble::Empty<TAG> >& data)
-	{
-		*out = make_pair(wibble::singleton(reversedNull), data.first);
-		++out;
-		return *this;
-	}
+	Reverser<OUT, TAG>& operator=(const std::pair< ITEMS, wibble::Empty<TAG> >& data);
 
 	template<typename ITEMS, typename TAGS>
-	Reverser<OUT, TAG>& operator=(const std::pair<ITEMS, TAGS>& data)
-	{
-		if (data.second.begin() == data.second.end())
-			*out = make_pair(wibble::singleton(reversedNull), data.first);
-		else
-			*out = make_pair(data.second, data.first);
-		++out;
-		return *this;
-	}
+	Reverser<OUT, TAG>& operator=(const std::pair<ITEMS, TAGS>& data);
 };
 
 template<typename OUT, typename TAG>
@@ -243,16 +203,7 @@
 	UngroupItems(const OUT& out) : out(out) {}
 
 	template<typename ITEMS, typename TAGS>
-	UngroupItems<OUT>& operator=(const std::pair<ITEMS, TAGS>& data)
-	{
-		for (typename ITEMS::const_iterator i = data.first.begin();
-				i != data.first.end(); ++i)
-		{
-			*out = make_pair(wibble::singleton(*i), data.second);
-			++out;
-		}
-		return *this;
-	}
+	UngroupItems<OUT>& operator=(const std::pair<ITEMS, TAGS>& data);
 };
 
 template<typename OUT>

Modified: tagcoll/2.0/tools/tagcoll.cc
==============================================================================
--- tagcoll/2.0/tools/tagcoll.cc	(original)
+++ tagcoll/2.0/tools/tagcoll.cc	Thu May 11 13:36:14 2006
@@ -770,6 +770,7 @@
 #include <tagcoll/TextFormat.tcc>
 #include <tagcoll/Patches.tcc>
 #include <tagcoll/Implications.tcc>
+#include <tagcoll/stream/filters.tcc>
 #include <tagcoll/coll/simple.tcc>
 #include <tagcoll/coll/fast.tcc>
 



More information about the Debtags-commits mailing list