From a4f7272de3bd63e646dda39aa00b0b407fac6f90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20K=C4=99dzia?= <Pawel.Kedzia@pwr.wroc.pl> Date: Tue, 6 Dec 2011 11:45:49 +0100 Subject: [PATCH] Wrapper to unordered::set to return std::set --- libwccl/values/strset.h | 7 +++++++ swig/strset.i | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/libwccl/values/strset.h b/libwccl/values/strset.h index 278a41c..0d1082a 100644 --- a/libwccl/values/strset.h +++ b/libwccl/values/strset.h @@ -70,6 +70,13 @@ public: return set_; } + /** + * Wrapper for boost::unordered set + */ + std::set<UnicodeString> to_std_set() const { + return std::set<UnicodeString>(this->set_.begin(), this->set_.end()); + } + void swap(StrSet& ss) { ss.set_.swap(set_); } diff --git a/swig/strset.i b/swig/strset.i index 4591c0e..b97243d 100644 --- a/swig/strset.i +++ b/swig/strset.i @@ -11,9 +11,12 @@ %include "value.i" %include "std_string.i" +%include "std_set.i" %feature("notabstract") Wccl::StrSet; +%template(UnicodeStringMap) std::set<UnicodeString>; + namespace Wccl { class StrSet : public Value { public: @@ -47,6 +50,9 @@ namespace Wccl { // UnicodeString to_raw_string_u() const; + + // + std::set<UnicodeString> to_std_set() const; }; } -- GitLab