From be086e8f72be53031e8b97843c4c210865afb500 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20K=C4=99dzia?= <Pawel.Kedzia@pwr.wroc.pl> Date: Thu, 17 Nov 2011 11:06:33 +0100 Subject: [PATCH] Wrapper for TokenMetaData --- swig/tokenmetadata.i | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 swig/tokenmetadata.i diff --git a/swig/tokenmetadata.i b/swig/tokenmetadata.i new file mode 100644 index 0000000..422442b --- /dev/null +++ b/swig/tokenmetadata.i @@ -0,0 +1,38 @@ +#ifndef SWIG_LIBCORPUS2_TOKENMETADATA_I +#define SWIG_LIBCORPUS2_TOKENMETADATA_I + +%module libcorpustokenmetadata +%{ + #include <libcorpus2/tokenmetadata.h> +%} + +%include "std_map.i" +%include "std_string.i" + +%include "std_defs.i" +%include "boost_shared_ptr.i" + +%feature("notabstract") Corpus2::TokenMetaData; + +%template(TokenMetaDataPtr) boost::shared_ptr<Corpus2::TokenMetaData>; + +namespace Corpus2 { + class TokenMetaData { + public: + TokenMetaData(); + ~TokenMetaData(); + + boost::shared_ptr<TokenMetaData> clone() const; + bool has_attribute(const std::string& name) const; + std::string get_attribute(const std::string& name) const; + void set_attribute(const std::string& name, const std::string& value); + + typedef std::map<std::string, std::string> attr_map_t; + const attr_map_t& attributes() const; + }; +} + +using namespace std; +using namespace Corpus2; + +#endif /* SWIG_LIBCORPUS2_TOKENMETADATA_I */ -- GitLab