* Fix c# string issues
This commit is contained in:
parent
374913e9d0
commit
a0f360c86c
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -36,8 +36,11 @@ namespace cAudio
|
|||
#if CAUDIO_REROUTE_STRING_ALLOCATIONS == 1
|
||||
typedef std::basic_string< cAudioChar, std::char_traits<cAudioChar>, cSTLAllocator<cAudioChar> > cAudioString;
|
||||
#else
|
||||
//typedef std::string cAudioString;
|
||||
typedef std::basic_string<cAudioChar> cAudioString;
|
||||
# if defined(UNICODE) || defined(_UNICODE)
|
||||
typedef std::basic_string<cAudioChar> cAudioString;
|
||||
# else
|
||||
typedef std::string cAudioString;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
@ -109,8 +109,8 @@ public class IAudioDecoder : IRefCounted {
|
|||
return ret;
|
||||
}
|
||||
|
||||
public virtual SWIGTYPE_p_std__basic_stringT_char_t getType() {
|
||||
SWIGTYPE_p_std__basic_stringT_char_t ret = new SWIGTYPE_p_std__basic_stringT_char_t(cAudioCSharpWrapperPINVOKE.IAudioDecoder_getType(swigCPtr), true);
|
||||
public virtual string getType() {
|
||||
string ret = cAudioCSharpWrapperPINVOKE.IAudioDecoder_getType(swigCPtr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -216,8 +216,8 @@ public class IAudioDecoder : IRefCounted {
|
|||
return getCurrentCompressedPosition();
|
||||
}
|
||||
|
||||
private IntPtr SwigDirectorgetType() {
|
||||
return SWIGTYPE_p_std__basic_stringT_char_t.getCPtr(getType()).Handle;
|
||||
private string SwigDirectorgetType() {
|
||||
return getType();
|
||||
}
|
||||
|
||||
public delegate void SwigDelegateIAudioDecoder_0();
|
||||
|
@ -235,7 +235,7 @@ public class IAudioDecoder : IRefCounted {
|
|||
public delegate float SwigDelegateIAudioDecoder_12();
|
||||
public delegate int SwigDelegateIAudioDecoder_13();
|
||||
public delegate int SwigDelegateIAudioDecoder_14();
|
||||
public delegate IntPtr SwigDelegateIAudioDecoder_15();
|
||||
public delegate string SwigDelegateIAudioDecoder_15();
|
||||
|
||||
private SwigDelegateIAudioDecoder_0 swigDelegate0;
|
||||
private SwigDelegateIAudioDecoder_1 swigDelegate1;
|
||||
|
|
|
@ -46,18 +46,18 @@ public class IAudioDeviceList : IDisposable {
|
|||
return ret;
|
||||
}
|
||||
|
||||
public virtual SWIGTYPE_p_std__basic_stringT_char_t getDeviceName(uint idx) {
|
||||
SWIGTYPE_p_std__basic_stringT_char_t ret = new SWIGTYPE_p_std__basic_stringT_char_t(cAudioCSharpWrapperPINVOKE.IAudioDeviceList_getDeviceName(swigCPtr, idx), true);
|
||||
public virtual string getDeviceName(uint idx) {
|
||||
string ret = cAudioCSharpWrapperPINVOKE.IAudioDeviceList_getDeviceName(swigCPtr, idx);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public virtual SWIGTYPE_p_std__basic_stringT_char_t getDeviceDescription(uint idx) {
|
||||
SWIGTYPE_p_std__basic_stringT_char_t ret = new SWIGTYPE_p_std__basic_stringT_char_t(cAudioCSharpWrapperPINVOKE.IAudioDeviceList_getDeviceDescription(swigCPtr, idx), true);
|
||||
public virtual string getDeviceDescription(uint idx) {
|
||||
string ret = cAudioCSharpWrapperPINVOKE.IAudioDeviceList_getDeviceDescription(swigCPtr, idx);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public virtual SWIGTYPE_p_std__basic_stringT_char_t getDefaultDeviceName() {
|
||||
SWIGTYPE_p_std__basic_stringT_char_t ret = new SWIGTYPE_p_std__basic_stringT_char_t(cAudioCSharpWrapperPINVOKE.IAudioDeviceList_getDefaultDeviceName(swigCPtr), true);
|
||||
public virtual string getDefaultDeviceName() {
|
||||
string ret = cAudioCSharpWrapperPINVOKE.IAudioDeviceList_getDefaultDeviceName(swigCPtr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,30 +0,0 @@
|
|||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 2.0.4
|
||||
*
|
||||
* Do not make changes to this file unless you know what you are doing--modify
|
||||
* the SWIG interface file instead.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
namespace cAudio {
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
public class SWIGTYPE_p_std__basic_stringT_char_t {
|
||||
private HandleRef swigCPtr;
|
||||
|
||||
internal SWIGTYPE_p_std__basic_stringT_char_t(IntPtr cPtr, bool futureUse) {
|
||||
swigCPtr = new HandleRef(this, cPtr);
|
||||
}
|
||||
|
||||
protected SWIGTYPE_p_std__basic_stringT_char_t() {
|
||||
swigCPtr = new HandleRef(null, IntPtr.Zero);
|
||||
}
|
||||
|
||||
internal static HandleRef getCPtr(SWIGTYPE_p_std__basic_stringT_char_t obj) {
|
||||
return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -66,7 +66,6 @@
|
|||
<Compile Include="SWIGTYPE_p_cAudio__IAudioEffects.cs" />
|
||||
<Compile Include="SWIGTYPE_p_float.cs" />
|
||||
<Compile Include="SWIGTYPE_p_p_char.cs" />
|
||||
<Compile Include="SWIGTYPE_p_std__basic_stringT_char_t.cs" />
|
||||
<Compile Include="SWIGTYPE_p_void.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
|
|
|
@ -17,14 +17,14 @@ public class cAudioCSharpWrapper {
|
|||
return ret;
|
||||
}
|
||||
|
||||
public static string toUTF8(SWIGTYPE_p_std__basic_stringT_char_t str) {
|
||||
string ret = cAudioCSharpWrapperPINVOKE.toUTF8(SWIGTYPE_p_std__basic_stringT_char_t.getCPtr(str));
|
||||
public static string toUTF8(string str) {
|
||||
string ret = cAudioCSharpWrapperPINVOKE.toUTF8(str);
|
||||
if (cAudioCSharpWrapperPINVOKE.SWIGPendingException.Pending) throw cAudioCSharpWrapperPINVOKE.SWIGPendingException.Retrieve();
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static SWIGTYPE_p_std__basic_stringT_char_t fromUTF8(string str) {
|
||||
SWIGTYPE_p_std__basic_stringT_char_t ret = new SWIGTYPE_p_std__basic_stringT_char_t(cAudioCSharpWrapperPINVOKE.fromUTF8(str), true);
|
||||
public static string fromUTF8(string str) {
|
||||
string ret = cAudioCSharpWrapperPINVOKE.fromUTF8(str);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
@ -193,10 +193,10 @@ class cAudioCSharpWrapperPINVOKE {
|
|||
public static extern string toWINSTR(string jarg1);
|
||||
|
||||
[DllImport("cAudioCSharpWrapper", EntryPoint="CSharp_toUTF8")]
|
||||
public static extern string toUTF8(HandleRef jarg1);
|
||||
public static extern string toUTF8(string jarg1);
|
||||
|
||||
[DllImport("cAudioCSharpWrapper", EntryPoint="CSharp_fromUTF8")]
|
||||
public static extern IntPtr fromUTF8(string jarg1);
|
||||
public static extern string fromUTF8(string jarg1);
|
||||
|
||||
[DllImport("cAudioCSharpWrapper", EntryPoint="CSharp_IMemoryProvider_Allocate")]
|
||||
public static extern IntPtr IMemoryProvider_Allocate(HandleRef jarg1, uint jarg2, string jarg3, int jarg4, string jarg5);
|
||||
|
@ -232,13 +232,13 @@ class cAudioCSharpWrapperPINVOKE {
|
|||
public static extern uint IAudioDeviceList_getDeviceCount(HandleRef jarg1);
|
||||
|
||||
[DllImport("cAudioCSharpWrapper", EntryPoint="CSharp_IAudioDeviceList_getDeviceName")]
|
||||
public static extern IntPtr IAudioDeviceList_getDeviceName(HandleRef jarg1, uint jarg2);
|
||||
public static extern string IAudioDeviceList_getDeviceName(HandleRef jarg1, uint jarg2);
|
||||
|
||||
[DllImport("cAudioCSharpWrapper", EntryPoint="CSharp_IAudioDeviceList_getDeviceDescription")]
|
||||
public static extern IntPtr IAudioDeviceList_getDeviceDescription(HandleRef jarg1, uint jarg2);
|
||||
public static extern string IAudioDeviceList_getDeviceDescription(HandleRef jarg1, uint jarg2);
|
||||
|
||||
[DllImport("cAudioCSharpWrapper", EntryPoint="CSharp_IAudioDeviceList_getDefaultDeviceName")]
|
||||
public static extern IntPtr IAudioDeviceList_getDefaultDeviceName(HandleRef jarg1);
|
||||
public static extern string IAudioDeviceList_getDefaultDeviceName(HandleRef jarg1);
|
||||
|
||||
[DllImport("cAudioCSharpWrapper", EntryPoint="CSharp_IAudioDeviceList_isSupported")]
|
||||
public static extern bool IAudioDeviceList_isSupported(HandleRef jarg1);
|
||||
|
@ -727,7 +727,7 @@ class cAudioCSharpWrapperPINVOKE {
|
|||
public static extern int IAudioDecoder_getCurrentCompressedPosition(HandleRef jarg1);
|
||||
|
||||
[DllImport("cAudioCSharpWrapper", EntryPoint="CSharp_IAudioDecoder_getType")]
|
||||
public static extern IntPtr IAudioDecoder_getType(HandleRef jarg1);
|
||||
public static extern string IAudioDecoder_getType(HandleRef jarg1);
|
||||
|
||||
[DllImport("cAudioCSharpWrapper", EntryPoint="CSharp_IAudioDecoder_director_connect")]
|
||||
public static extern void IAudioDecoder_director_connect(HandleRef jarg1, IAudioDecoder.SwigDelegateIAudioDecoder_0 delegate0, IAudioDecoder.SwigDelegateIAudioDecoder_1 delegate1, IAudioDecoder.SwigDelegateIAudioDecoder_2 delegate2, IAudioDecoder.SwigDelegateIAudioDecoder_3 delegate3, IAudioDecoder.SwigDelegateIAudioDecoder_4 delegate4, IAudioDecoder.SwigDelegateIAudioDecoder_5 delegate5, IAudioDecoder.SwigDelegateIAudioDecoder_6 delegate6, IAudioDecoder.SwigDelegateIAudioDecoder_7 delegate7, IAudioDecoder.SwigDelegateIAudioDecoder_8 delegate8, IAudioDecoder.SwigDelegateIAudioDecoder_9 delegate9, IAudioDecoder.SwigDelegateIAudioDecoder_10 delegate10, IAudioDecoder.SwigDelegateIAudioDecoder_11 delegate11, IAudioDecoder.SwigDelegateIAudioDecoder_12 delegate12, IAudioDecoder.SwigDelegateIAudioDecoder_13 delegate13, IAudioDecoder.SwigDelegateIAudioDecoder_14 delegate14, IAudioDecoder.SwigDelegateIAudioDecoder_15 delegate15);
|
||||
|
|
|
@ -6,6 +6,8 @@
|
|||
|
||||
#define CAUDIO_API
|
||||
|
||||
typedef basic_string<char> cAudioString;
|
||||
|
||||
%{
|
||||
#include "cAudioString.h"
|
||||
#include "IRefCounted.h"
|
||||
|
|
|
@ -1398,18 +1398,18 @@ int SwigDirector_IAudioDecoder::getCurrentCompressedPosition() {
|
|||
}
|
||||
|
||||
cAudio::cAudioString SwigDirector_IAudioDecoder::getType() const {
|
||||
cAudio::cAudioString c_result = SwigValueInit< cAudio::cAudioString >() ;
|
||||
void * jresult = 0 ;
|
||||
cAudio::cAudioString c_result ;
|
||||
char * jresult = 0 ;
|
||||
|
||||
if (!swig_callbackgetType) {
|
||||
throw Swig::DirectorPureVirtualException("cAudio::IAudioDecoder::getType");
|
||||
} else {
|
||||
jresult = (void *) swig_callbackgetType();
|
||||
jresult = (char *) swig_callbackgetType();
|
||||
if (!jresult) {
|
||||
SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Unexpected null return for type cAudio::cAudioString", 0);
|
||||
SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "null string", 0);
|
||||
return c_result;
|
||||
}
|
||||
c_result = *(cAudio::cAudioString *)jresult;
|
||||
c_result.assign(jresult);
|
||||
}
|
||||
return c_result;
|
||||
}
|
||||
|
@ -1501,30 +1501,31 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_toWINSTR(char * jarg1) {
|
|||
}
|
||||
|
||||
|
||||
SWIGEXPORT char * SWIGSTDCALL CSharp_toUTF8(void * jarg1) {
|
||||
SWIGEXPORT char * SWIGSTDCALL CSharp_toUTF8(char * jarg1) {
|
||||
char * jresult ;
|
||||
cAudio::cAudioString *arg1 = 0 ;
|
||||
char *result = 0 ;
|
||||
|
||||
arg1 = (cAudio::cAudioString *)jarg1;
|
||||
if (!arg1) {
|
||||
SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "cAudio::cAudioString const & type is null", 0);
|
||||
if (!jarg1) {
|
||||
SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "null string", 0);
|
||||
return 0;
|
||||
}
|
||||
result = (char *)cAudio::toUTF8((std::basic_string< char > const &)*arg1);
|
||||
}
|
||||
std::string arg1_str(jarg1);
|
||||
arg1 = &arg1_str;
|
||||
result = (char *)cAudio::toUTF8((std::string const &)*arg1);
|
||||
jresult = SWIG_csharp_string_callback((const char *)result);
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void * SWIGSTDCALL CSharp_fromUTF8(char * jarg1) {
|
||||
void * jresult ;
|
||||
SWIGEXPORT char * SWIGSTDCALL CSharp_fromUTF8(char * jarg1) {
|
||||
char * jresult ;
|
||||
char *arg1 = (char *) 0 ;
|
||||
cAudio::cAudioString result;
|
||||
|
||||
arg1 = (char *)jarg1;
|
||||
result = cAudio::fromUTF8((char const *)arg1);
|
||||
jresult = new cAudio::cAudioString((const cAudio::cAudioString &)result);
|
||||
jresult = SWIG_csharp_string_callback((&result)->c_str());
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
@ -1649,8 +1650,8 @@ SWIGEXPORT unsigned int SWIGSTDCALL CSharp_IAudioDeviceList_getDeviceCount(void
|
|||
}
|
||||
|
||||
|
||||
SWIGEXPORT void * SWIGSTDCALL CSharp_IAudioDeviceList_getDeviceName(void * jarg1, unsigned int jarg2) {
|
||||
void * jresult ;
|
||||
SWIGEXPORT char * SWIGSTDCALL CSharp_IAudioDeviceList_getDeviceName(void * jarg1, unsigned int jarg2) {
|
||||
char * jresult ;
|
||||
cAudio::IAudioDeviceList *arg1 = (cAudio::IAudioDeviceList *) 0 ;
|
||||
unsigned int arg2 ;
|
||||
cAudio::cAudioString result;
|
||||
|
@ -1658,13 +1659,13 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_IAudioDeviceList_getDeviceName(void * jarg1
|
|||
arg1 = (cAudio::IAudioDeviceList *)jarg1;
|
||||
arg2 = (unsigned int)jarg2;
|
||||
result = (arg1)->getDeviceName(arg2);
|
||||
jresult = new cAudio::cAudioString((const cAudio::cAudioString &)result);
|
||||
jresult = SWIG_csharp_string_callback((&result)->c_str());
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void * SWIGSTDCALL CSharp_IAudioDeviceList_getDeviceDescription(void * jarg1, unsigned int jarg2) {
|
||||
void * jresult ;
|
||||
SWIGEXPORT char * SWIGSTDCALL CSharp_IAudioDeviceList_getDeviceDescription(void * jarg1, unsigned int jarg2) {
|
||||
char * jresult ;
|
||||
cAudio::IAudioDeviceList *arg1 = (cAudio::IAudioDeviceList *) 0 ;
|
||||
unsigned int arg2 ;
|
||||
cAudio::cAudioString result;
|
||||
|
@ -1672,19 +1673,19 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_IAudioDeviceList_getDeviceDescription(void
|
|||
arg1 = (cAudio::IAudioDeviceList *)jarg1;
|
||||
arg2 = (unsigned int)jarg2;
|
||||
result = (arg1)->getDeviceDescription(arg2);
|
||||
jresult = new cAudio::cAudioString((const cAudio::cAudioString &)result);
|
||||
jresult = SWIG_csharp_string_callback((&result)->c_str());
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void * SWIGSTDCALL CSharp_IAudioDeviceList_getDefaultDeviceName(void * jarg1) {
|
||||
void * jresult ;
|
||||
SWIGEXPORT char * SWIGSTDCALL CSharp_IAudioDeviceList_getDefaultDeviceName(void * jarg1) {
|
||||
char * jresult ;
|
||||
cAudio::IAudioDeviceList *arg1 = (cAudio::IAudioDeviceList *) 0 ;
|
||||
cAudio::cAudioString result;
|
||||
|
||||
arg1 = (cAudio::IAudioDeviceList *)jarg1;
|
||||
result = (arg1)->getDefaultDeviceName();
|
||||
jresult = new cAudio::cAudioString((const cAudio::cAudioString &)result);
|
||||
jresult = SWIG_csharp_string_callback((&result)->c_str());
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
@ -3652,14 +3653,14 @@ SWIGEXPORT int SWIGSTDCALL CSharp_IAudioDecoder_getCurrentCompressedPosition(voi
|
|||
}
|
||||
|
||||
|
||||
SWIGEXPORT void * SWIGSTDCALL CSharp_IAudioDecoder_getType(void * jarg1) {
|
||||
void * jresult ;
|
||||
SWIGEXPORT char * SWIGSTDCALL CSharp_IAudioDecoder_getType(void * jarg1) {
|
||||
char * jresult ;
|
||||
cAudio::IAudioDecoder *arg1 = (cAudio::IAudioDecoder *) 0 ;
|
||||
cAudio::cAudioString result;
|
||||
|
||||
arg1 = (cAudio::IAudioDecoder *)jarg1;
|
||||
result = ((cAudio::IAudioDecoder const *)arg1)->getType();
|
||||
jresult = new cAudio::cAudioString((const cAudio::cAudioString &)result);
|
||||
jresult = SWIG_csharp_string_callback((&result)->c_str());
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
|
|
@ -194,7 +194,7 @@ public:
|
|||
typedef float (SWIGSTDCALL* SWIG_Callback12_t)();
|
||||
typedef int (SWIGSTDCALL* SWIG_Callback13_t)();
|
||||
typedef int (SWIGSTDCALL* SWIG_Callback14_t)();
|
||||
typedef void * (SWIGSTDCALL* SWIG_Callback15_t)();
|
||||
typedef char * (SWIGSTDCALL* SWIG_Callback15_t)();
|
||||
void swig_connect_director(SWIG_Callback0_t callbackgrab, SWIG_Callback1_t callbackdrop, SWIG_Callback2_t callbackgetFormat, SWIG_Callback3_t callbackgetFrequency, SWIG_Callback4_t callbackisSeekingSupported, SWIG_Callback5_t callbackisValid, SWIG_Callback6_t callbackreadAudioData, SWIG_Callback7_t callbacksetPosition, SWIG_Callback8_t callbackseek, SWIG_Callback9_t callbackgetTotalTime, SWIG_Callback10_t callbackgetTotalSize, SWIG_Callback11_t callbackgetCompressedSize, SWIG_Callback12_t callbackgetCurrentTime, SWIG_Callback13_t callbackgetCurrentPosition, SWIG_Callback14_t callbackgetCurrentCompressedPosition, SWIG_Callback15_t callbackgetType);
|
||||
|
||||
private:
|
||||
|
|
Loading…
Reference in New Issue