[Debtags-commits] [svn] r711 - in libdebtags/trunk: . debtags swig swig/perl swig/python

Enrico Zini debtags-commits@lists.alioth.debian.org
Sat, 07 May 2005 20:28:19 +0000


Author: enrico
Date: Sat May  7 20:28:19 2005
New Revision: 711

Added:
   libdebtags/trunk/swig/perl/mksearchpage   (contents, props changed)
   libdebtags/trunk/swig/python/Makefile.am
   libdebtags/trunk/swig/python/test.py
Removed:
   libdebtags/trunk/swig/test.py
Modified:
   libdebtags/trunk/   (props changed)
   libdebtags/trunk/configure.ac
   libdebtags/trunk/debtags/Tag.cc
   libdebtags/trunk/debtags/Tag.h
   libdebtags/trunk/debtags/TagImpl.cc
   libdebtags/trunk/debtags/TagImpl.h
   libdebtags/trunk/swig/Makefile.am
Log:
 r2890@viaza:  enrico | 2005-05-06 13:57:06 +0200
 Smart pointers did not initialize their reference to 0 (thanks to valgrind for helping me finding it)
 Moved python wrappers to a separate directory
 Added mksearchpackage perl script to experiment with the new facet metadata


Modified: libdebtags/trunk/configure.ac
==============================================================================
--- libdebtags/trunk/configure.ac	(original)
+++ libdebtags/trunk/configure.ac	Sat May  7 20:28:19 2005
@@ -57,7 +57,7 @@
 #extra_warnings="-W -Wsystem-headers -Wfloat-equal -Wundef -Wendif-labels -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Wsign-compare -Wstrict-prototypes -Wmissing-prototypes -Wmissing-noreturn -Wmissing-format-attribute -Wno-multichar -Wno-deprecated-declarations -Wpacked -Wpadded -Wredundant-decls -Wunreachable-code -Winline -Wlong-long -Wdisabled-optimization"
 dnl -Waggregate-return 
 
-CXXFLAGS="$CXXFLAGS -Wall $extra_warnings -O0"
+CXXFLAGS="$CXXFLAGS -Wall $extra_warnings"
 dnl -Werror
 
 AC_CONFIG_FILES([
@@ -66,6 +66,7 @@
 tests/Makefile
 swig/Makefile
 swig/perl/Makefile
+swig/python/Makefile
 doc/Makefile
 libdebtags.pc
 ])

Modified: libdebtags/trunk/debtags/Tag.cc
==============================================================================
--- libdebtags/trunk/debtags/Tag.cc	(original)
+++ libdebtags/trunk/debtags/Tag.cc	Sat May  7 20:28:19 2005
@@ -69,6 +69,7 @@
 std::string Facet::sdesc() const throw () { return impl->sdesc(); }
 std::string Facet::ldesc() const throw () { return impl->ldesc(); }
 std::string Facet::fulldata() const throw () { return impl->fulldata(); }
+std::string Facet::field(const std::string& name) const throw () { return impl->field(name); }
 
 bool Facet::hasTag(const std::string& name) const throw ()
 {
@@ -145,6 +146,7 @@
 std::string Tag::sdesc() const throw () { return impl->sdesc(); }
 std::string Tag::ldesc() const throw () { return impl->ldesc(); }
 std::string Tag::fulldata() const throw () { return impl->fulldata(); }
+std::string Tag::field(const std::string& name) const throw () { return impl->field(name); }
 
 Facet Tag::facet() const throw ()
 {

Modified: libdebtags/trunk/debtags/Tag.h
==============================================================================
--- libdebtags/trunk/debtags/Tag.h	(original)
+++ libdebtags/trunk/debtags/Tag.h	Sat May  7 20:28:19 2005
@@ -56,6 +56,11 @@
 	std::string fulldata() const throw ();
 
 	/**
+	 * Return the content of an arbitrary field
+	 */
+	std::string field(const std::string& name) const throw();
+
+	/**
 	 * Return true if the facet has a tag with the given name (name, not fullname)
 	 */
 	bool hasTag(const std::string& name) const throw ();
@@ -146,6 +151,11 @@
 	 */
 	std::string fulldata() const throw ();
 
+	/**
+	 * Return the content of an arbitrary field
+	 */
+	std::string field(const std::string& name) const throw();
+
 #if 0
 	const std::string& sdesc() const throw ();
 	const std::string& ldesc() const throw ();

Modified: libdebtags/trunk/debtags/TagImpl.cc
==============================================================================
--- libdebtags/trunk/debtags/TagImpl.cc	(original)
+++ libdebtags/trunk/debtags/TagImpl.cc	Sat May  7 20:28:19 2005
@@ -61,6 +61,12 @@
 	return string(start, stop-start);
 }
 
+std::string FacetImpl::field(const std::string& name) const throw()
+{
+	return data.FindS(name.c_str());
+}
+
+
 TagSet FacetImpl::tags() const throw ()
 {
 	return voc.getTags(name());
@@ -130,6 +136,11 @@
 	return string(start, stop-start);
 }
 
+std::string TagImpl::field(const std::string& name) const throw()
+{
+	return data.FindS(name.c_str());
+}
+
 
 #if 0
 #include <tagcoll/TagSet.h>

Modified: libdebtags/trunk/debtags/TagImpl.h
==============================================================================
--- libdebtags/trunk/debtags/TagImpl.h	(original)
+++ libdebtags/trunk/debtags/TagImpl.h	Sat May  7 20:28:19 2005
@@ -56,6 +56,11 @@
 	std::string ldesc() const throw ();
 	std::string fulldata() const throw ();
 
+	/**
+	 * Return the content of an arbitrary field
+	 */
+	std::string field(const std::string& name) const throw();
+
 	TagSet tags() const throw ();
 
 #if 0
@@ -93,6 +98,11 @@
 	std::string ldesc() const throw ();
 	std::string fulldata() const throw ();
 
+	/**
+	 * Return the content of an arbitrary field
+	 */
+	std::string field(const std::string& name) const throw();
+
 	friend class Tag;
 	friend class Vocabulary;
 };

Modified: libdebtags/trunk/swig/Makefile.am
==============================================================================
--- libdebtags/trunk/swig/Makefile.am	(original)
+++ libdebtags/trunk/swig/Makefile.am	Sat May  7 20:28:19 2005
@@ -1,19 +1,5 @@
 ## Process this file with automake to produce Makefile.in
 
-SUBDIRS = . perl
-
-python_LTLIBRARIES = _Debtags.la
-python_DATA = Debtags.py
-
-nodist__Debtags_la_SOURCES = libdebtags_wrap_python.cc
-_Debtags_la_LDFLAGS = -module
-_Debtags_la_LIBADD = $(LIBTAGCOLL_LIBS) -lapt-pkg ../debtags/libdebtags1.la
-
-libdebtags_wrap_python.cc: libdebtags.i
-	swig -python -c++ -o $@ $<
-
-INCLUDES = $(LIBTAGCOLL_CFLAGS) -DSTATEDIR=\"$(statedir)\" -I/usr/include/python2.3
+SUBDIRS = . perl python
 
 EXTRA_DIST = libdebtags.i
-
-CLEANFILES = libdebtags_wrap_python.cc Debtags.py Debtags.pyc