summaryrefslogtreecommitdiffstats
path: root/src/bindings
diff options
context:
space:
mode:
authorStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2014-07-06 16:04:18 (GMT)
committerStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2014-07-06 16:04:18 (GMT)
commit9cc762d85afffea42de3e1d156a6b8838d88a00c (patch)
treebff170c0493759c7f1bffca2648960b6f43ca139 /src/bindings
parentbe98a8297b4e10e169290f497e649e803e43d791 (diff)
downloaduscxml-9cc762d85afffea42de3e1d156a6b8838d88a00c.zip
uscxml-9cc762d85afffea42de3e1d156a6b8838d88a00c.tar.gz
uscxml-9cc762d85afffea42de3e1d156a6b8838d88a00c.tar.bz2
Made Blob into Pimpl to better support language bindings
Diffstat (limited to 'src/bindings')
-rw-r--r--src/bindings/swig/csharp/uscxml.i12
-rw-r--r--src/bindings/swig/java/uscxml.i5
-rw-r--r--src/bindings/swig/uscxml_ignores.i2
3 files changed, 16 insertions, 3 deletions
diff --git a/src/bindings/swig/csharp/uscxml.i b/src/bindings/swig/csharp/uscxml.i
index bd8c669..7625c8d 100644
--- a/src/bindings/swig/csharp/uscxml.i
+++ b/src/bindings/swig/csharp/uscxml.i
@@ -13,6 +13,7 @@
%include <boost_shared_ptr.i>
// these are needed at least for the templates to work
+typedef uscxml::Blob Blob;
typedef uscxml::Data Data;
typedef uscxml::Event Event;
typedef uscxml::InvokeRequest InvokeRequest;
@@ -161,11 +162,16 @@ WRAP_TO_STRING(uscxml::InvokeRequest);
// byte[] signature for Blob get/setData
// see http://permalink.gmane.org/gmane.comp.programming.swig/5804
+%csmethodmodifiers uscxml::Blob::setData(const char* data, size_t length) "private";
+%csmethodmodifiers uscxml::Blob::setMimeType(const std::string& mimeType) "private";
%csmethodmodifiers uscxml::Blob::Blob(const char* data, size_t size, const std::string& mimeType) "private";
+%csmethodmodifiers uscxml::Blob::Blob(const char* data, size_t size) "private";
+
%typemap(cscode) uscxml::Blob %{
- public Blob(byte[] data, string mimeType) : this(uscxmlNativeCSharpPINVOKE.new_Blob(data, (uint)data.Length, mimeType), true) {
+ public Blob(byte[] data, string mimeType) : this(uscxmlNativeCSharpPINVOKE.new_Blob__SWIG_2(data, (uint)data.Length, mimeType), true) {
if (uscxmlNativeCSharpPINVOKE.SWIGPendingException.Pending) throw uscxmlNativeCSharpPINVOKE.SWIGPendingException.Retrieve();
}
+
%}
%typemap(imtype, out="System.IntPtr") const char *data "byte[]"
@@ -251,6 +257,10 @@ using System.Runtime.InteropServices;
%}
%typemap(cscode) uscxml::Data %{
+ public Data(byte[] data, String mimeType) : this() {
+ setBinary(new Blob(data, mimeType));
+ }
+
public Data(List<Data> arr) : this() {
setArray(arr);
}
diff --git a/src/bindings/swig/java/uscxml.i b/src/bindings/swig/java/uscxml.i
index 9610e77..654ea91 100644
--- a/src/bindings/swig/java/uscxml.i
+++ b/src/bindings/swig/java/uscxml.i
@@ -13,6 +13,7 @@
%include <boost_shared_ptr.i>
// these are needed at least for the templates to work
+typedef uscxml::Blob Blob;
typedef uscxml::Data Data;
typedef uscxml::Event Event;
typedef uscxml::InvokeRequest InvokeRequest;
@@ -184,7 +185,6 @@ BEAUTIFY_NATIVE(uscxml::InvokeRequest, InvokeRequest, InvokeRequestNative);
JCALL4(SetByteArrayRegion, jenv, $result, 0, ((uscxml::Blob const *)arg1)->getSize(), (jbyte *)$1);
}
-
//***********************************************
// Beautify important classes
//***********************************************
@@ -254,7 +254,8 @@ import java.util.LinkedList;
%typemap(javacode) uscxml::Data %{
public Data(byte[] data, String mimeType) {
-
+ this(uscxmlNativeJavaJNI.new_Data__SWIG_0(), true);
+ setBinary(new Blob(data, mimeType));
}
public Data(Map<String, Data> compound) {
diff --git a/src/bindings/swig/uscxml_ignores.i b/src/bindings/swig/uscxml_ignores.i
index 5e99416..9a0dbe4 100644
--- a/src/bindings/swig/uscxml_ignores.i
+++ b/src/bindings/swig/uscxml_ignores.i
@@ -1,6 +1,7 @@
%ignore uscxml::NumAttr;
%ignore uscxml::SCXMLParser;
%ignore uscxml::InterpreterImpl;
+%ignore uscxml::BlobImpl;
#if 0
%ignore uscxml::EventHandlerImpl;
#endif
@@ -196,6 +197,7 @@
%ignore uscxml::Blob::Blob(size_t size);
%ignore uscxml::Blob::Blob(const char* data, size_t size, const std::string& mimeType, bool adopt);
+%ignore uscxml::Blob::Blob(const boost::shared_ptr<BlobImpl>);
%ignore operator!=;