Browse Source

Regenerated the parser bindings.

Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
pull/888/head
Dimitar Dobrev 8 years ago
parent
commit
f4d9259450
  1. 2196
      src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/CppSharp.CppParser.cs
  2. 3
      src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/Std-symbols.cpp
  3. 305
      src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/Std.cs
  4. 2196
      src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/CppSharp.CppParser.cs
  5. 3
      src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/Std-symbols.cpp
  6. 193
      src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/Std.cs
  7. 2196
      src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/CppSharp.CppParser.cs
  8. 3
      src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/Std-symbols.cpp
  9. 305
      src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/Std.cs
  10. 2196
      src/CppParser/Bindings/CSharp/x86_64-linux-gnu-cxx11abi/CppSharp.CppParser.cs
  11. 3
      src/CppParser/Bindings/CSharp/x86_64-linux-gnu-cxx11abi/Std-symbols.cpp
  12. 238
      src/CppParser/Bindings/CSharp/x86_64-linux-gnu-cxx11abi/Std.cs
  13. 2196
      src/CppParser/Bindings/CSharp/x86_64-linux-gnu/CppSharp.CppParser.cs
  14. 3
      src/CppParser/Bindings/CSharp/x86_64-linux-gnu/Std-symbols.cpp
  15. 269
      src/CppParser/Bindings/CSharp/x86_64-linux-gnu/Std.cs
  16. 2196
      src/CppParser/Bindings/CSharp/x86_64-pc-win32-msvc/CppSharp.CppParser.cs
  17. 3
      src/CppParser/Bindings/CSharp/x86_64-pc-win32-msvc/Std-symbols.cpp
  18. 193
      src/CppParser/Bindings/CSharp/x86_64-pc-win32-msvc/Std.cs

2196
src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/CppSharp.CppParser.cs

File diff suppressed because it is too large Load Diff

3
src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/Std-symbols.cpp

@ -1,6 +1,7 @@ @@ -1,6 +1,7 @@
#include <string>
template __attribute__((visibility("default"))) std::__1::allocator<char>::allocator() noexcept;
template __attribute__((visibility("default"))) std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>::basic_string(const std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>::value_type*, const std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>::allocator_type&);
template __attribute__((visibility("default"))) std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>::~basic_string();
template __attribute__((visibility("default"))) const std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>::value_type* std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>::c_str() const noexcept;
template __attribute__((visibility("default"))) std::__1::allocator<char>::allocator() noexcept;

305
src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/Std.cs

@ -140,7 +140,7 @@ namespace Std @@ -140,7 +140,7 @@ namespace Std
{
namespace __1
{
public unsafe partial class Allocator : IDisposable
namespace Allocator
{
[StructLayout(LayoutKind.Explicit, Size = 0)]
public unsafe partial struct __Internal
@ -148,25 +148,28 @@ namespace Std @@ -148,25 +148,28 @@ namespace Std
[SuppressUnmanagedCodeSecurity]
[DllImport("Std-symbols", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="_ZNSt3__19allocatorIcEC2Ev")]
internal static extern void ctorc__N_std_N___1_S_allocator__C_0(global::System.IntPtr instance);
internal static extern void ctorc__N_std_N___1_S_allocator__C(global::System.IntPtr instance);
}
}
public unsafe partial class Allocator<_Tp> : IDisposable
{
public global::System.IntPtr __Instance { get; protected set; }
protected int __PointerAdjustment;
internal static readonly global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::Std.__1.Allocator> NativeToManagedMap = new global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::Std.__1.Allocator>();
internal static readonly global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::Std.__1.Allocator<_Tp>> NativeToManagedMap = new global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::Std.__1.Allocator<_Tp>>();
protected void*[] __OriginalVTables;
protected bool __ownsNativeInstance;
internal static global::Std.__1.Allocator __CreateInstance(global::System.IntPtr native, bool skipVTables = false)
internal static global::Std.__1.Allocator<_Tp> __CreateInstance(global::System.IntPtr native, bool skipVTables = false)
{
return new global::Std.__1.Allocator(native.ToPointer(), skipVTables);
return new global::Std.__1.Allocator<_Tp>(native.ToPointer(), skipVTables);
}
internal static global::Std.__1.Allocator __CreateInstance(global::Std.__1.Allocator.__Internal native, bool skipVTables = false)
internal static global::Std.__1.Allocator<_Tp> __CreateInstance(global::Std.__1.Allocator.__Internal native, bool skipVTables = false)
{
return new global::Std.__1.Allocator(native, skipVTables);
return new global::Std.__1.Allocator<_Tp>(native, skipVTables);
}
private static void* __CopyValue(global::Std.__1.Allocator.__Internal native)
@ -192,10 +195,16 @@ namespace Std @@ -192,10 +195,16 @@ namespace Std
public Allocator()
{
__Instance = Marshal.AllocHGlobal(sizeof(global::Std.__1.Allocator.__Internal));
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
global::Std.__1.Allocator.__Internal.ctorc__N_std_N___1_S_allocator__C_0((__Instance + __PointerAdjustment));
var ___Tp = typeof(_Tp);
if (___Tp.IsAssignableFrom(typeof(sbyte)))
{
__Instance = Marshal.AllocHGlobal(sizeof(global::Std.__1.Allocator.__Internal));
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
global::Std.__1.Allocator.__Internal.ctorc__N_std_N___1_S_allocator__C((__Instance + __PointerAdjustment));
return;
}
throw new global::System.InvalidOperationException();
}
public void Dispose()
@ -207,7 +216,7 @@ namespace Std @@ -207,7 +216,7 @@ namespace Std
{
if (__Instance == IntPtr.Zero)
return;
global::Std.__1.Allocator __dummy;
global::Std.__1.Allocator<_Tp> __dummy;
NativeToManagedMap.TryRemove(__Instance, out __dummy);
if (__ownsNativeInstance)
Marshal.FreeHGlobal(__Instance);
@ -1247,56 +1256,131 @@ namespace Std @@ -1247,56 +1256,131 @@ namespace Std
{
namespace __1
{
public unsafe partial class BasicString : IDisposable
namespace CharTraits
{
[StructLayout(LayoutKind.Explicit, Size = 12)]
[StructLayout(LayoutKind.Explicit, Size = 0)]
public unsafe partial struct __Internal
{
[FieldOffset(0)]
internal global::Std.__1.CompressedPair.__Internal __r_;
}
}
[SuppressUnmanagedCodeSecurity]
[DllImport("Std-symbols", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2EPKcRKS4_")]
internal static extern void ctorc__N_std_N___1_S_basic_string__C___N_std_N___1_S_char_traits__C___N_std_N___1_S_allocator__C_0(global::System.IntPtr instance, [MarshalAs(UnmanagedType.LPStr)] string __s, global::System.IntPtr __a);
public unsafe partial class CharTraits<_CharT> : IDisposable
{
public global::System.IntPtr __Instance { get; protected set; }
protected int __PointerAdjustment;
internal static readonly global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::Std.__1.CharTraits<_CharT>> NativeToManagedMap = new global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::Std.__1.CharTraits<_CharT>>();
protected void*[] __OriginalVTables;
protected bool __ownsNativeInstance;
internal static global::Std.__1.CharTraits<_CharT> __CreateInstance(global::System.IntPtr native, bool skipVTables = false)
{
return new global::Std.__1.CharTraits<_CharT>(native.ToPointer(), skipVTables);
}
internal static global::Std.__1.CharTraits<_CharT> __CreateInstance(global::Std.__1.CharTraits.__Internal native, bool skipVTables = false)
{
return new global::Std.__1.CharTraits<_CharT>(native, skipVTables);
}
private static void* __CopyValue(global::Std.__1.CharTraits.__Internal native)
{
var ret = Marshal.AllocHGlobal(sizeof(global::Std.__1.CharTraits.__Internal));
*(global::Std.__1.CharTraits.__Internal*) ret = native;
return ret.ToPointer();
}
private CharTraits(global::Std.__1.CharTraits.__Internal native, bool skipVTables = false)
: this(__CopyValue(native), skipVTables)
{
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
}
protected CharTraits(void* native, bool skipVTables = false)
{
if (native == null)
return;
__Instance = new global::System.IntPtr(native);
}
public void Dispose()
{
Dispose(disposing: true);
}
public virtual void Dispose(bool disposing)
{
if (__Instance == IntPtr.Zero)
return;
global::Std.__1.CharTraits<_CharT> __dummy;
NativeToManagedMap.TryRemove(__Instance, out __dummy);
if (__ownsNativeInstance)
Marshal.FreeHGlobal(__Instance);
__Instance = IntPtr.Zero;
}
}
public unsafe static partial class BasicStringExtensions
{
[StructLayout(LayoutKind.Explicit, Size = 0)]
public partial struct __Internal
{
[SuppressUnmanagedCodeSecurity]
[DllImport("Std-symbols", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev")]
internal static extern void dtorc__N_std_N___1_S_basic_string__C___N_std_N___1_S_char_traits__C___N_std_N___1_S_allocator__C_0(global::System.IntPtr instance);
EntryPoint="_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2EPKcRKS4_")]
internal static extern global::System.IntPtr BasicString(global::System.IntPtr instance, [MarshalAs(UnmanagedType.LPStr)] string __s, global::System.IntPtr __a);
[SuppressUnmanagedCodeSecurity]
[DllImport("Std-symbols", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5c_strEv")]
internal static extern global::System.IntPtr CStrc__N_std_N___1_S_basic_string__C___N_std_N___1_S_char_traits__C___N_std_N___1_S_allocator__C(global::System.IntPtr instance);
internal static extern global::System.IntPtr CStr(global::System.IntPtr instance);
}
internal enum ShortMask : uint
public static global::Std.__1.BasicString<sbyte, global::Std.__1.CharTraits<sbyte>, global::Std.__1.Allocator<sbyte>> BasicString(string __s, global::Std.__1.Allocator<sbyte> __a)
{
ShortMask = 0x1
if (ReferenceEquals(__a, null))
throw new global::System.ArgumentNullException("__a", "Cannot be null because it is a C++ reference (&).");
var __arg1 = __a.__Instance;
var __ret = Marshal.AllocHGlobal(12);
__Internal.BasicString(__ret, __s, __arg1);
global::Std.__1.BasicString<sbyte, global::Std.__1.CharTraits<sbyte>, global::Std.__1.Allocator<sbyte>> __result0;
if (__ret == IntPtr.Zero) __result0 = null;
else if (global::Std.__1.BasicString<sbyte, global::Std.__1.CharTraits<sbyte>, global::Std.__1.Allocator<sbyte>>.NativeToManagedMap.ContainsKey(__ret))
__result0 = (global::Std.__1.BasicString<sbyte, global::Std.__1.CharTraits<sbyte>, global::Std.__1.Allocator<sbyte>>) global::Std.__1.BasicString<sbyte, global::Std.__1.CharTraits<sbyte>, global::Std.__1.Allocator<sbyte>>.NativeToManagedMap[__ret];
else __result0 = global::Std.__1.BasicString<sbyte, global::Std.__1.CharTraits<sbyte>, global::Std.__1.Allocator<sbyte>>.__CreateInstance(__ret);
return __result0;
}
internal enum LongMask : uint
public static string CStr(this global::Std.__1.BasicString<sbyte, global::Std.__1.CharTraits<sbyte>, global::Std.__1.Allocator<sbyte>> @this)
{
LongMask = 0x1
var __arg0 = ReferenceEquals(@this, null) ? global::System.IntPtr.Zero : @this.__Instance;
var __ret = __Internal.CStr(__arg0);
return Marshal.PtrToStringAnsi(__ret);
}
}
internal enum MinCap : uint
namespace BasicString
{
[StructLayout(LayoutKind.Explicit, Size = 12)]
public unsafe partial struct __Internal
{
MinCap = 11
}
[FieldOffset(0)]
internal global::Std.__1.CompressedPair.__Internal __r_;
internal enum NWords : uint
{
NWords = 3
}
[SuppressUnmanagedCodeSecurity]
[DllImport("Std-symbols", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev")]
internal static extern void dtorc__N_std_N___1_S_basic_string__C___N_std_N___1_S_char_traits__C___N_std_N___1_S_allocator__C(global::System.IntPtr instance);
[Flags]
internal enum Alignment : uint
{
Alignment = 16
[SuppressUnmanagedCodeSecurity]
[DllImport("Std-symbols", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5c_strEv")]
internal static extern global::System.IntPtr CStrc__N_std_N___1_S_basic_string__C___N_std_N___1_S_char_traits__C___N_std_N___1_S_allocator__C(global::System.IntPtr instance);
}
public unsafe partial class Rep
{
[StructLayout(LayoutKind.Explicit, Size = 12)]
@ -1306,6 +1390,7 @@ namespace Std @@ -1306,6 +1390,7 @@ namespace Std
internal global::Std.__1.BasicString.Rep._.__Internal _;
}
public unsafe partial struct _
{
[StructLayout(LayoutKind.Explicit, Size = 12)]
@ -1320,6 +1405,7 @@ namespace Std @@ -1320,6 +1405,7 @@ namespace Std
[FieldOffset(0)]
internal global::Std.__1.BasicString.Raw.__Internal __r;
}
}
}
@ -1337,6 +1423,7 @@ namespace Std @@ -1337,6 +1423,7 @@ namespace Std
[FieldOffset(8)]
internal global::System.IntPtr __data_;
}
}
public unsafe partial class Short
@ -1351,6 +1438,7 @@ namespace Std @@ -1351,6 +1438,7 @@ namespace Std
internal fixed sbyte __data_[11];
}
public unsafe partial struct _
{
[StructLayout(LayoutKind.Explicit, Size = 1)]
@ -1362,6 +1450,7 @@ namespace Std @@ -1362,6 +1450,7 @@ namespace Std
[FieldOffset(0)]
internal sbyte __lx;
}
}
}
@ -1373,6 +1462,7 @@ namespace Std @@ -1373,6 +1462,7 @@ namespace Std
[FieldOffset(0)]
internal fixed uint __words[3];
}
}
public unsafe partial struct Ulx
@ -1387,23 +1477,51 @@ namespace Std @@ -1387,23 +1477,51 @@ namespace Std
internal global::Std.__1.BasicString.Short.__Internal __lxx;
}
}
}
public unsafe partial class BasicString<_CharT, _Traits, _Allocator> : IDisposable
{
internal enum ShortMask
{
ShortMask = 0
}
internal enum LongMask
{
LongMask = 0
}
internal enum MinCap
{
MinCap = 0
}
internal enum NWords
{
NWords = 0
}
internal enum Alignment
{
Alignment = 0
}
public global::System.IntPtr __Instance { get; protected set; }
protected int __PointerAdjustment;
internal static readonly global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::Std.__1.BasicString> NativeToManagedMap = new global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::Std.__1.BasicString>();
internal static readonly global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::Std.__1.BasicString<_CharT, _Traits, _Allocator>> NativeToManagedMap = new global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::Std.__1.BasicString<_CharT, _Traits, _Allocator>>();
protected void*[] __OriginalVTables;
protected bool __ownsNativeInstance;
internal static global::Std.__1.BasicString __CreateInstance(global::System.IntPtr native, bool skipVTables = false)
internal static global::Std.__1.BasicString<_CharT, _Traits, _Allocator> __CreateInstance(global::System.IntPtr native, bool skipVTables = false)
{
return new global::Std.__1.BasicString(native.ToPointer(), skipVTables);
return new global::Std.__1.BasicString<_CharT, _Traits, _Allocator>(native.ToPointer(), skipVTables);
}
internal static global::Std.__1.BasicString __CreateInstance(global::Std.__1.BasicString.__Internal native, bool skipVTables = false)
internal static global::Std.__1.BasicString<_CharT, _Traits, _Allocator> __CreateInstance(global::Std.__1.BasicString.__Internal native, bool skipVTables = false)
{
return new global::Std.__1.BasicString(native, skipVTables);
return new global::Std.__1.BasicString<_CharT, _Traits, _Allocator>(native, skipVTables);
}
private static void* __CopyValue(global::Std.__1.BasicString.__Internal native)
@ -1427,17 +1545,6 @@ namespace Std @@ -1427,17 +1545,6 @@ namespace Std
__Instance = new global::System.IntPtr(native);
}
public BasicString(string __s, global::Std.__1.Allocator __a)
{
__Instance = Marshal.AllocHGlobal(sizeof(global::Std.__1.BasicString.__Internal));
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
if (ReferenceEquals(__a, null))
throw new global::System.ArgumentNullException("__a", "Cannot be null because it is a C++ reference (&).");
var __arg1 = __a.__Instance;
global::Std.__1.BasicString.__Internal.ctorc__N_std_N___1_S_basic_string__C___N_std_N___1_S_char_traits__C___N_std_N___1_S_allocator__C_0((__Instance + __PointerAdjustment), __s, __arg1);
}
public void Dispose()
{
Dispose(disposing: true);
@ -1447,90 +1554,24 @@ namespace Std @@ -1447,90 +1554,24 @@ namespace Std
{
if (__Instance == IntPtr.Zero)
return;
global::Std.__1.BasicString __dummy;
global::Std.__1.BasicString<_CharT, _Traits, _Allocator> __dummy;
NativeToManagedMap.TryRemove(__Instance, out __dummy);
if (disposing)
global::Std.__1.BasicString.__Internal.dtorc__N_std_N___1_S_basic_string__C___N_std_N___1_S_char_traits__C___N_std_N___1_S_allocator__C_0((__Instance + __PointerAdjustment));
{
var ___CharT = typeof(_CharT);
var ___Traits = typeof(_Traits);
var ___Allocator = typeof(_Allocator);
if (___CharT.IsAssignableFrom(typeof(sbyte)) && ___Traits.IsAssignableFrom(typeof(global::Std.__1.CharTraits<sbyte>)) && ___Allocator.IsAssignableFrom(typeof(global::Std.__1.Allocator<sbyte>)))
{
global::Std.__1.BasicString.__Internal.dtorc__N_std_N___1_S_basic_string__C___N_std_N___1_S_char_traits__C___N_std_N___1_S_allocator__C((__Instance + __PointerAdjustment));
return;
}
throw new global::System.InvalidOperationException();
}
if (__ownsNativeInstance)
Marshal.FreeHGlobal(__Instance);
__Instance = IntPtr.Zero;
}
public string CStr
{
get
{
var __ret = global::Std.__1.BasicString.__Internal.CStrc__N_std_N___1_S_basic_string__C___N_std_N___1_S_char_traits__C___N_std_N___1_S_allocator__C((__Instance + __PointerAdjustment));
return Marshal.PtrToStringAnsi(__ret);
}
}
}
public unsafe partial class Rep
{
[StructLayout(LayoutKind.Explicit, Size = 12)]
public partial struct __Internal
{
[FieldOffset(0)]
internal global::Std.__1.BasicString.Rep._.__Internal _;
}
}
public unsafe partial class Long
{
[StructLayout(LayoutKind.Explicit, Size = 12)]
public partial struct __Internal
{
[FieldOffset(0)]
internal uint __cap_;
[FieldOffset(4)]
internal uint __size_;
[FieldOffset(8)]
internal global::System.IntPtr __data_;
}
}
public unsafe partial class Short
{
[StructLayout(LayoutKind.Explicit, Size = 12)]
public partial struct __Internal
{
[FieldOffset(0)]
internal global::Std.__1.BasicString.Short._.__Internal _;
[FieldOffset(1)]
internal fixed sbyte __data_[11];
}
}
public unsafe partial class Raw
{
[StructLayout(LayoutKind.Explicit, Size = 12)]
public partial struct __Internal
{
[FieldOffset(0)]
internal fixed uint __words[3];
}
}
public unsafe partial struct Ulx
{
[StructLayout(LayoutKind.Explicit, Size = 12)]
public partial struct __Internal
{
[FieldOffset(0)]
internal global::Std.__1.BasicString.Long.__Internal __lx;
[FieldOffset(0)]
internal global::Std.__1.BasicString.Short.__Internal __lxx;
}
}
}
}

2196
src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/CppSharp.CppParser.cs

File diff suppressed because it is too large Load Diff

3
src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/Std-symbols.cpp

@ -1,6 +1,7 @@ @@ -1,6 +1,7 @@
#include <string>
template __declspec(dllexport) std::allocator<char>::allocator() noexcept;
template __declspec(dllexport) std::basic_string<char, std::char_traits<char>, std::allocator<char>>::basic_string(const char*, const std::allocator<char>&);
template __declspec(dllexport) std::basic_string<char, std::char_traits<char>, std::allocator<char>>::~basic_string() noexcept;
template __declspec(dllexport) const char* std::basic_string<char, std::char_traits<char>, std::allocator<char>>::c_str() const noexcept;
template __declspec(dllexport) std::allocator<char>::allocator() noexcept;

193
src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/Std.cs

@ -57,6 +57,71 @@ public unsafe partial class StdExceptionData @@ -57,6 +57,71 @@ public unsafe partial class StdExceptionData
namespace Std
{
namespace CharTraits
{
[StructLayout(LayoutKind.Explicit, Size = 0)]
public unsafe partial struct __Internal
{
}
}
public unsafe partial class CharTraits<_Elem> : IDisposable
{
public global::System.IntPtr __Instance { get; protected set; }
protected int __PointerAdjustment;
internal static readonly global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::Std.CharTraits<_Elem>> NativeToManagedMap = new global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::Std.CharTraits<_Elem>>();
protected void*[] __OriginalVTables;
protected bool __ownsNativeInstance;
internal static global::Std.CharTraits<_Elem> __CreateInstance(global::System.IntPtr native, bool skipVTables = false)
{
return new global::Std.CharTraits<_Elem>(native.ToPointer(), skipVTables);
}
internal static global::Std.CharTraits<_Elem> __CreateInstance(global::Std.CharTraits.__Internal native, bool skipVTables = false)
{
return new global::Std.CharTraits<_Elem>(native, skipVTables);
}
private static void* __CopyValue(global::Std.CharTraits.__Internal native)
{
var ret = Marshal.AllocHGlobal(sizeof(global::Std.CharTraits.__Internal));
*(global::Std.CharTraits.__Internal*) ret = native;
return ret.ToPointer();
}
private CharTraits(global::Std.CharTraits.__Internal native, bool skipVTables = false)
: this(__CopyValue(native), skipVTables)
{
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
}
protected CharTraits(void* native, bool skipVTables = false)
{
if (native == null)
return;
__Instance = new global::System.IntPtr(native);
}
public void Dispose()
{
Dispose(disposing: true);
}
public virtual void Dispose(bool disposing)
{
if (__Instance == IntPtr.Zero)
return;
global::Std.CharTraits<_Elem> __dummy;
NativeToManagedMap.TryRemove(__Instance, out __dummy);
if (__ownsNativeInstance)
Marshal.FreeHGlobal(__Instance);
__Instance = IntPtr.Zero;
}
}
}
namespace Std
@ -395,7 +460,7 @@ namespace Std @@ -395,7 +460,7 @@ namespace Std
namespace Std
{
public unsafe partial class Allocator : IDisposable
namespace Allocator
{
[StructLayout(LayoutKind.Explicit, Size = 0)]
public unsafe partial struct __Internal
@ -403,25 +468,28 @@ namespace Std @@ -403,25 +468,28 @@ namespace Std
[SuppressUnmanagedCodeSecurity]
[DllImport("Std-symbols", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall,
EntryPoint="??0?$allocator@D@std@@QAE@XZ")]
internal static extern global::System.IntPtr ctorc__N_std_S_allocator__C_0(global::System.IntPtr instance);
internal static extern global::System.IntPtr ctorc__N_std_S_allocator__C(global::System.IntPtr instance);
}
}
public unsafe partial class Allocator<_Ty> : IDisposable
{
public global::System.IntPtr __Instance { get; protected set; }
protected int __PointerAdjustment;
internal static readonly global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::Std.Allocator> NativeToManagedMap = new global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::Std.Allocator>();
internal static readonly global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::Std.Allocator<_Ty>> NativeToManagedMap = new global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::Std.Allocator<_Ty>>();
protected void*[] __OriginalVTables;
protected bool __ownsNativeInstance;
internal static global::Std.Allocator __CreateInstance(global::System.IntPtr native, bool skipVTables = false)
internal static global::Std.Allocator<_Ty> __CreateInstance(global::System.IntPtr native, bool skipVTables = false)
{
return new global::Std.Allocator(native.ToPointer(), skipVTables);
return new global::Std.Allocator<_Ty>(native.ToPointer(), skipVTables);
}
internal static global::Std.Allocator __CreateInstance(global::Std.Allocator.__Internal native, bool skipVTables = false)
internal static global::Std.Allocator<_Ty> __CreateInstance(global::Std.Allocator.__Internal native, bool skipVTables = false)
{
return new global::Std.Allocator(native, skipVTables);
return new global::Std.Allocator<_Ty>(native, skipVTables);
}
private static void* __CopyValue(global::Std.Allocator.__Internal native)
@ -447,10 +515,16 @@ namespace Std @@ -447,10 +515,16 @@ namespace Std
public Allocator()
{
__Instance = Marshal.AllocHGlobal(sizeof(global::Std.Allocator.__Internal));
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
global::Std.Allocator.__Internal.ctorc__N_std_S_allocator__C_0((__Instance + __PointerAdjustment));
var ___Ty = typeof(_Ty);
if (___Ty.IsAssignableFrom(typeof(sbyte)))
{
__Instance = Marshal.AllocHGlobal(sizeof(global::Std.Allocator.__Internal));
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
global::Std.Allocator.__Internal.ctorc__N_std_S_allocator__C((__Instance + __PointerAdjustment));
return;
}
throw new global::System.InvalidOperationException();
}
public void Dispose()
@ -462,7 +536,7 @@ namespace Std @@ -462,7 +536,7 @@ namespace Std
{
if (__Instance == IntPtr.Zero)
return;
global::Std.Allocator __dummy;
global::Std.Allocator<_Ty> __dummy;
NativeToManagedMap.TryRemove(__Instance, out __dummy);
if (__ownsNativeInstance)
Marshal.FreeHGlobal(__Instance);
@ -477,7 +551,46 @@ namespace Std @@ -477,7 +551,46 @@ namespace Std
namespace Std
{
public unsafe partial class BasicString : IDisposable
public unsafe static partial class BasicStringExtensions
{
[StructLayout(LayoutKind.Explicit, Size = 0)]
public partial struct __Internal
{
[SuppressUnmanagedCodeSecurity]
[DllImport("Std-symbols", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall,
EntryPoint="??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@PBDABV?$allocator@D@1@@Z")]
internal static extern global::System.IntPtr BasicString(global::System.IntPtr instance, [MarshalAs(UnmanagedType.LPStr)] string _Ptr, global::System.IntPtr _Al);
[SuppressUnmanagedCodeSecurity]
[DllImport("Std-symbols", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall,
EntryPoint="?c_str@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEPBDXZ")]
internal static extern global::System.IntPtr CStr(global::System.IntPtr instance);
}
public static global::Std.BasicString<sbyte, global::Std.CharTraits<sbyte>, global::Std.Allocator<sbyte>> BasicString(string _Ptr, global::Std.Allocator<sbyte> _Al)
{
if (ReferenceEquals(_Al, null))
throw new global::System.ArgumentNullException("_Al", "Cannot be null because it is a C++ reference (&).");
var __arg1 = _Al.__Instance;
var __ret = Marshal.AllocHGlobal(24);
__Internal.BasicString(__ret, _Ptr, __arg1);
global::Std.BasicString<sbyte, global::Std.CharTraits<sbyte>, global::Std.Allocator<sbyte>> __result0;
if (__ret == IntPtr.Zero) __result0 = null;
else if (global::Std.BasicString<sbyte, global::Std.CharTraits<sbyte>, global::Std.Allocator<sbyte>>.NativeToManagedMap.ContainsKey(__ret))
__result0 = (global::Std.BasicString<sbyte, global::Std.CharTraits<sbyte>, global::Std.Allocator<sbyte>>) global::Std.BasicString<sbyte, global::Std.CharTraits<sbyte>, global::Std.Allocator<sbyte>>.NativeToManagedMap[__ret];
else __result0 = global::Std.BasicString<sbyte, global::Std.CharTraits<sbyte>, global::Std.Allocator<sbyte>>.__CreateInstance(__ret);
return __result0;
}
public static string CStr(this global::Std.BasicString<sbyte, global::Std.CharTraits<sbyte>, global::Std.Allocator<sbyte>> @this)
{
var __arg0 = ReferenceEquals(@this, null) ? global::System.IntPtr.Zero : @this.__Instance;
var __ret = __Internal.CStr(__arg0);
return Marshal.PtrToStringAnsi(__ret);
}
}
namespace BasicString
{
[StructLayout(LayoutKind.Explicit, Size = 24)]
public unsafe partial struct __Internal
@ -485,38 +598,36 @@ namespace Std @@ -485,38 +598,36 @@ namespace Std
[FieldOffset(0)]
internal global::Std.CompressedPair.__Internalc__N_std_S__Compressed_pair____N_std_S__Wrap_alloc____N_std_S_allocator__C___N_std_S__String_val____N_std_S__Simple_types__C_Vb1 _Mypair;
[SuppressUnmanagedCodeSecurity]
[DllImport("Std-symbols", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall,
EntryPoint="??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@PBDABV?$allocator@D@1@@Z")]
internal static extern global::System.IntPtr ctorc__N_std_S_basic_string__C___N_std_S_char_traits__C___N_std_S_allocator__C_0(global::System.IntPtr instance, [MarshalAs(UnmanagedType.LPStr)] string _Ptr, global::System.IntPtr _Al);
[SuppressUnmanagedCodeSecurity]
[DllImport("Std-symbols", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall,
EntryPoint="??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ")]
internal static extern void dtorc__N_std_S_basic_string__C___N_std_S_char_traits__C___N_std_S_allocator__C_0(global::System.IntPtr instance, int delete);
internal static extern void dtorc__N_std_S_basic_string__C___N_std_S_char_traits__C___N_std_S_allocator__C(global::System.IntPtr instance, int delete);
[SuppressUnmanagedCodeSecurity]
[DllImport("Std-symbols", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall,
EntryPoint="?c_str@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEPBDXZ")]
internal static extern global::System.IntPtr CStrc__N_std_S_basic_string__C___N_std_S_char_traits__C___N_std_S_allocator__C(global::System.IntPtr instance);
}
}
public unsafe partial class BasicString<_Elem, _Traits, _Alloc> : IDisposable
{
public global::System.IntPtr __Instance { get; protected set; }
protected int __PointerAdjustment;
internal static readonly global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::Std.BasicString> NativeToManagedMap = new global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::Std.BasicString>();
internal static readonly global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::Std.BasicString<_Elem, _Traits, _Alloc>> NativeToManagedMap = new global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::Std.BasicString<_Elem, _Traits, _Alloc>>();
protected void*[] __OriginalVTables;
protected bool __ownsNativeInstance;
internal static global::Std.BasicString __CreateInstance(global::System.IntPtr native, bool skipVTables = false)
internal static global::Std.BasicString<_Elem, _Traits, _Alloc> __CreateInstance(global::System.IntPtr native, bool skipVTables = false)
{
return new global::Std.BasicString(native.ToPointer(), skipVTables);
return new global::Std.BasicString<_Elem, _Traits, _Alloc>(native.ToPointer(), skipVTables);
}
internal static global::Std.BasicString __CreateInstance(global::Std.BasicString.__Internal native, bool skipVTables = false)
internal static global::Std.BasicString<_Elem, _Traits, _Alloc> __CreateInstance(global::Std.BasicString.__Internal native, bool skipVTables = false)
{
return new global::Std.BasicString(native, skipVTables);
return new global::Std.BasicString<_Elem, _Traits, _Alloc>(native, skipVTables);
}
private static void* __CopyValue(global::Std.BasicString.__Internal native)
@ -540,17 +651,6 @@ namespace Std @@ -540,17 +651,6 @@ namespace Std
__Instance = new global::System.IntPtr(native);
}
public BasicString(string _Ptr, global::Std.Allocator _Al)
{
__Instance = Marshal.AllocHGlobal(sizeof(global::Std.BasicString.__Internal));
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
if (ReferenceEquals(_Al, null))
throw new global::System.ArgumentNullException("_Al", "Cannot be null because it is a C++ reference (&).");
var __arg1 = ((global::Std.Allocator) (object) _Al).__Instance;
global::Std.BasicString.__Internal.ctorc__N_std_S_basic_string__C___N_std_S_char_traits__C___N_std_S_allocator__C_0((__Instance + __PointerAdjustment), _Ptr, __arg1);
}
public void Dispose()
{
Dispose(disposing: true);
@ -560,23 +660,24 @@ namespace Std @@ -560,23 +660,24 @@ namespace Std
{
if (__Instance == IntPtr.Zero)
return;
global::Std.BasicString __dummy;
global::Std.BasicString<_Elem, _Traits, _Alloc> __dummy;
NativeToManagedMap.TryRemove(__Instance, out __dummy);
if (disposing)
global::Std.BasicString.__Internal.dtorc__N_std_S_basic_string__C___N_std_S_char_traits__C___N_std_S_allocator__C_0((__Instance + __PointerAdjustment), 0);
{
var ___Elem = typeof(_Elem);
var ___Traits = typeof(_Traits);
var ___Alloc = typeof(_Alloc);
if (___Elem.IsAssignableFrom(typeof(sbyte)) && ___Traits.IsAssignableFrom(typeof(global::Std.CharTraits<sbyte>)) && ___Alloc.IsAssignableFrom(typeof(global::Std.Allocator<sbyte>)))
{
global::Std.BasicString.__Internal.dtorc__N_std_S_basic_string__C___N_std_S_char_traits__C___N_std_S_allocator__C((__Instance + __PointerAdjustment), 0);
return;
}
throw new global::System.InvalidOperationException();
}
if (__ownsNativeInstance)
Marshal.FreeHGlobal(__Instance);
__Instance = IntPtr.Zero;
}
public string CStr
{
get
{
var __ret = global::Std.BasicString.__Internal.CStrc__N_std_S_basic_string__C___N_std_S_char_traits__C___N_std_S_allocator__C((__Instance + __PointerAdjustment));
return Marshal.PtrToStringAnsi(__ret);
}
}
}
namespace StringVal

2196
src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/CppSharp.CppParser.cs

File diff suppressed because it is too large Load Diff

3
src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/Std-symbols.cpp

@ -1,6 +1,7 @@ @@ -1,6 +1,7 @@
#include <string>
template __attribute__((visibility("default"))) std::__1::allocator<char>::allocator() noexcept;
template __attribute__((visibility("default"))) std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>::basic_string(const std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>::value_type*, const std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>::allocator_type&);
template __attribute__((visibility("default"))) std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>::~basic_string();
template __attribute__((visibility("default"))) const std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>::value_type* std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>::c_str() const noexcept;
template __attribute__((visibility("default"))) std::__1::allocator<char>::allocator() noexcept;

305
src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/Std.cs

@ -140,7 +140,7 @@ namespace Std @@ -140,7 +140,7 @@ namespace Std
{
namespace __1
{
public unsafe partial class Allocator : IDisposable
namespace Allocator
{
[StructLayout(LayoutKind.Explicit, Size = 0)]
public unsafe partial struct __Internal
@ -148,25 +148,28 @@ namespace Std @@ -148,25 +148,28 @@ namespace Std
[SuppressUnmanagedCodeSecurity]
[DllImport("Std-symbols", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="_ZNSt3__19allocatorIcEC2Ev")]
internal static extern void ctorc__N_std_N___1_S_allocator__C_0(global::System.IntPtr instance);
internal static extern void ctorc__N_std_N___1_S_allocator__C(global::System.IntPtr instance);
}
}
public unsafe partial class Allocator<_Tp> : IDisposable
{
public global::System.IntPtr __Instance { get; protected set; }
protected int __PointerAdjustment;
internal static readonly global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::Std.__1.Allocator> NativeToManagedMap = new global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::Std.__1.Allocator>();
internal static readonly global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::Std.__1.Allocator<_Tp>> NativeToManagedMap = new global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::Std.__1.Allocator<_Tp>>();
protected void*[] __OriginalVTables;
protected bool __ownsNativeInstance;
internal static global::Std.__1.Allocator __CreateInstance(global::System.IntPtr native, bool skipVTables = false)
internal static global::Std.__1.Allocator<_Tp> __CreateInstance(global::System.IntPtr native, bool skipVTables = false)
{
return new global::Std.__1.Allocator(native.ToPointer(), skipVTables);
return new global::Std.__1.Allocator<_Tp>(native.ToPointer(), skipVTables);
}
internal static global::Std.__1.Allocator __CreateInstance(global::Std.__1.Allocator.__Internal native, bool skipVTables = false)
internal static global::Std.__1.Allocator<_Tp> __CreateInstance(global::Std.__1.Allocator.__Internal native, bool skipVTables = false)
{
return new global::Std.__1.Allocator(native, skipVTables);
return new global::Std.__1.Allocator<_Tp>(native, skipVTables);
}
private static void* __CopyValue(global::Std.__1.Allocator.__Internal native)
@ -192,10 +195,16 @@ namespace Std @@ -192,10 +195,16 @@ namespace Std
public Allocator()
{
__Instance = Marshal.AllocHGlobal(sizeof(global::Std.__1.Allocator.__Internal));
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
global::Std.__1.Allocator.__Internal.ctorc__N_std_N___1_S_allocator__C_0((__Instance + __PointerAdjustment));
var ___Tp = typeof(_Tp);
if (___Tp.IsAssignableFrom(typeof(sbyte)))
{
__Instance = Marshal.AllocHGlobal(sizeof(global::Std.__1.Allocator.__Internal));
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
global::Std.__1.Allocator.__Internal.ctorc__N_std_N___1_S_allocator__C((__Instance + __PointerAdjustment));
return;
}
throw new global::System.InvalidOperationException();
}
public void Dispose()
@ -207,7 +216,7 @@ namespace Std @@ -207,7 +216,7 @@ namespace Std
{
if (__Instance == IntPtr.Zero)
return;
global::Std.__1.Allocator __dummy;
global::Std.__1.Allocator<_Tp> __dummy;
NativeToManagedMap.TryRemove(__Instance, out __dummy);
if (__ownsNativeInstance)
Marshal.FreeHGlobal(__Instance);
@ -1247,56 +1256,131 @@ namespace Std @@ -1247,56 +1256,131 @@ namespace Std
{
namespace __1
{
public unsafe partial class BasicString : IDisposable
namespace CharTraits
{
[StructLayout(LayoutKind.Explicit, Size = 24)]
[StructLayout(LayoutKind.Explicit, Size = 0)]
public unsafe partial struct __Internal
{
[FieldOffset(0)]
internal global::Std.__1.CompressedPair.__Internal __r_;
}
}
[SuppressUnmanagedCodeSecurity]
[DllImport("Std-symbols", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2EPKcRKS4_")]
internal static extern void ctorc__N_std_N___1_S_basic_string__C___N_std_N___1_S_char_traits__C___N_std_N___1_S_allocator__C_0(global::System.IntPtr instance, [MarshalAs(UnmanagedType.LPStr)] string __s, global::System.IntPtr __a);
public unsafe partial class CharTraits<_CharT> : IDisposable
{
public global::System.IntPtr __Instance { get; protected set; }
protected int __PointerAdjustment;
internal static readonly global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::Std.__1.CharTraits<_CharT>> NativeToManagedMap = new global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::Std.__1.CharTraits<_CharT>>();
protected void*[] __OriginalVTables;
protected bool __ownsNativeInstance;
internal static global::Std.__1.CharTraits<_CharT> __CreateInstance(global::System.IntPtr native, bool skipVTables = false)
{
return new global::Std.__1.CharTraits<_CharT>(native.ToPointer(), skipVTables);
}
internal static global::Std.__1.CharTraits<_CharT> __CreateInstance(global::Std.__1.CharTraits.__Internal native, bool skipVTables = false)
{
return new global::Std.__1.CharTraits<_CharT>(native, skipVTables);
}
private static void* __CopyValue(global::Std.__1.CharTraits.__Internal native)
{
var ret = Marshal.AllocHGlobal(sizeof(global::Std.__1.CharTraits.__Internal));
*(global::Std.__1.CharTraits.__Internal*) ret = native;
return ret.ToPointer();
}
private CharTraits(global::Std.__1.CharTraits.__Internal native, bool skipVTables = false)
: this(__CopyValue(native), skipVTables)
{
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
}
protected CharTraits(void* native, bool skipVTables = false)
{
if (native == null)
return;
__Instance = new global::System.IntPtr(native);
}
public void Dispose()
{
Dispose(disposing: true);
}
public virtual void Dispose(bool disposing)
{
if (__Instance == IntPtr.Zero)
return;
global::Std.__1.CharTraits<_CharT> __dummy;
NativeToManagedMap.TryRemove(__Instance, out __dummy);
if (__ownsNativeInstance)
Marshal.FreeHGlobal(__Instance);
__Instance = IntPtr.Zero;
}
}
public unsafe static partial class BasicStringExtensions
{
[StructLayout(LayoutKind.Explicit, Size = 0)]
public partial struct __Internal
{
[SuppressUnmanagedCodeSecurity]
[DllImport("Std-symbols", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev")]
internal static extern void dtorc__N_std_N___1_S_basic_string__C___N_std_N___1_S_char_traits__C___N_std_N___1_S_allocator__C_0(global::System.IntPtr instance);
EntryPoint="_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2EPKcRKS4_")]
internal static extern global::System.IntPtr BasicString(global::System.IntPtr instance, [MarshalAs(UnmanagedType.LPStr)] string __s, global::System.IntPtr __a);
[SuppressUnmanagedCodeSecurity]
[DllImport("Std-symbols", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5c_strEv")]
internal static extern global::System.IntPtr CStrc__N_std_N___1_S_basic_string__C___N_std_N___1_S_char_traits__C___N_std_N___1_S_allocator__C(global::System.IntPtr instance);
internal static extern global::System.IntPtr CStr(global::System.IntPtr instance);
}
internal enum ShortMask : uint
public static global::Std.__1.BasicString<sbyte, global::Std.__1.CharTraits<sbyte>, global::Std.__1.Allocator<sbyte>> BasicString(string __s, global::Std.__1.Allocator<sbyte> __a)
{
ShortMask = 0x1
if (ReferenceEquals(__a, null))
throw new global::System.ArgumentNullException("__a", "Cannot be null because it is a C++ reference (&).");
var __arg1 = __a.__Instance;
var __ret = Marshal.AllocHGlobal(24);
__Internal.BasicString(__ret, __s, __arg1);
global::Std.__1.BasicString<sbyte, global::Std.__1.CharTraits<sbyte>, global::Std.__1.Allocator<sbyte>> __result0;
if (__ret == IntPtr.Zero) __result0 = null;
else if (global::Std.__1.BasicString<sbyte, global::Std.__1.CharTraits<sbyte>, global::Std.__1.Allocator<sbyte>>.NativeToManagedMap.ContainsKey(__ret))
__result0 = (global::Std.__1.BasicString<sbyte, global::Std.__1.CharTraits<sbyte>, global::Std.__1.Allocator<sbyte>>) global::Std.__1.BasicString<sbyte, global::Std.__1.CharTraits<sbyte>, global::Std.__1.Allocator<sbyte>>.NativeToManagedMap[__ret];
else __result0 = global::Std.__1.BasicString<sbyte, global::Std.__1.CharTraits<sbyte>, global::Std.__1.Allocator<sbyte>>.__CreateInstance(__ret);
return __result0;
}
internal enum LongMask : uint
public static string CStr(this global::Std.__1.BasicString<sbyte, global::Std.__1.CharTraits<sbyte>, global::Std.__1.Allocator<sbyte>> @this)
{
LongMask = 0x1
var __arg0 = ReferenceEquals(@this, null) ? global::System.IntPtr.Zero : @this.__Instance;
var __ret = __Internal.CStr(__arg0);
return Marshal.PtrToStringAnsi(__ret);
}
}
internal enum MinCap : uint
namespace BasicString
{
[StructLayout(LayoutKind.Explicit, Size = 24)]
public unsafe partial struct __Internal
{
MinCap = 23
}
[FieldOffset(0)]
internal global::Std.__1.CompressedPair.__Internal __r_;
internal enum NWords : uint
{
NWords = 3
}
[SuppressUnmanagedCodeSecurity]
[DllImport("Std-symbols", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev")]
internal static extern void dtorc__N_std_N___1_S_basic_string__C___N_std_N___1_S_char_traits__C___N_std_N___1_S_allocator__C(global::System.IntPtr instance);
[Flags]
internal enum Alignment : uint
{
Alignment = 16
[SuppressUnmanagedCodeSecurity]
[DllImport("Std-symbols", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5c_strEv")]
internal static extern global::System.IntPtr CStrc__N_std_N___1_S_basic_string__C___N_std_N___1_S_char_traits__C___N_std_N___1_S_allocator__C(global::System.IntPtr instance);
}
public unsafe partial class Rep
{
[StructLayout(LayoutKind.Explicit, Size = 24)]
@ -1306,6 +1390,7 @@ namespace Std @@ -1306,6 +1390,7 @@ namespace Std
internal global::Std.__1.BasicString.Rep._.__Internal _;
}
public unsafe partial struct _
{
[StructLayout(LayoutKind.Explicit, Size = 24)]
@ -1320,6 +1405,7 @@ namespace Std @@ -1320,6 +1405,7 @@ namespace Std
[FieldOffset(0)]
internal global::Std.__1.BasicString.Raw.__Internal __r;
}
}
}
@ -1337,6 +1423,7 @@ namespace Std @@ -1337,6 +1423,7 @@ namespace Std
[FieldOffset(16)]
internal global::System.IntPtr __data_;
}
}
public unsafe partial class Short
@ -1351,6 +1438,7 @@ namespace Std @@ -1351,6 +1438,7 @@ namespace Std
internal fixed sbyte __data_[23];
}
public unsafe partial struct _
{
[StructLayout(LayoutKind.Explicit, Size = 1)]
@ -1362,6 +1450,7 @@ namespace Std @@ -1362,6 +1450,7 @@ namespace Std
[FieldOffset(0)]
internal sbyte __lx;
}
}
}
@ -1373,6 +1462,7 @@ namespace Std @@ -1373,6 +1462,7 @@ namespace Std
[FieldOffset(0)]
internal fixed ulong __words[3];
}
}
public unsafe partial struct Ulx
@ -1387,23 +1477,51 @@ namespace Std @@ -1387,23 +1477,51 @@ namespace Std
internal global::Std.__1.BasicString.Short.__Internal __lxx;
}
}
}
public unsafe partial class BasicString<_CharT, _Traits, _Allocator> : IDisposable
{
internal enum ShortMask
{
ShortMask = 0
}
internal enum LongMask
{
LongMask = 0
}
internal enum MinCap
{
MinCap = 0
}
internal enum NWords
{
NWords = 0
}
internal enum Alignment
{
Alignment = 0
}
public global::System.IntPtr __Instance { get; protected set; }
protected int __PointerAdjustment;
internal static readonly global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::Std.__1.BasicString> NativeToManagedMap = new global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::Std.__1.BasicString>();
internal static readonly global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::Std.__1.BasicString<_CharT, _Traits, _Allocator>> NativeToManagedMap = new global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::Std.__1.BasicString<_CharT, _Traits, _Allocator>>();
protected void*[] __OriginalVTables;
protected bool __ownsNativeInstance;
internal static global::Std.__1.BasicString __CreateInstance(global::System.IntPtr native, bool skipVTables = false)
internal static global::Std.__1.BasicString<_CharT, _Traits, _Allocator> __CreateInstance(global::System.IntPtr native, bool skipVTables = false)
{
return new global::Std.__1.BasicString(native.ToPointer(), skipVTables);
return new global::Std.__1.BasicString<_CharT, _Traits, _Allocator>(native.ToPointer(), skipVTables);
}
internal static global::Std.__1.BasicString __CreateInstance(global::Std.__1.BasicString.__Internal native, bool skipVTables = false)
internal static global::Std.__1.BasicString<_CharT, _Traits, _Allocator> __CreateInstance(global::Std.__1.BasicString.__Internal native, bool skipVTables = false)
{
return new global::Std.__1.BasicString(native, skipVTables);
return new global::Std.__1.BasicString<_CharT, _Traits, _Allocator>(native, skipVTables);
}
private static void* __CopyValue(global::Std.__1.BasicString.__Internal native)
@ -1427,17 +1545,6 @@ namespace Std @@ -1427,17 +1545,6 @@ namespace Std
__Instance = new global::System.IntPtr(native);
}
public BasicString(string __s, global::Std.__1.Allocator __a)
{
__Instance = Marshal.AllocHGlobal(sizeof(global::Std.__1.BasicString.__Internal));
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
if (ReferenceEquals(__a, null))
throw new global::System.ArgumentNullException("__a", "Cannot be null because it is a C++ reference (&).");
var __arg1 = __a.__Instance;
global::Std.__1.BasicString.__Internal.ctorc__N_std_N___1_S_basic_string__C___N_std_N___1_S_char_traits__C___N_std_N___1_S_allocator__C_0((__Instance + __PointerAdjustment), __s, __arg1);
}
public void Dispose()
{
Dispose(disposing: true);
@ -1447,90 +1554,24 @@ namespace Std @@ -1447,90 +1554,24 @@ namespace Std
{
if (__Instance == IntPtr.Zero)
return;
global::Std.__1.BasicString __dummy;
global::Std.__1.BasicString<_CharT, _Traits, _Allocator> __dummy;
NativeToManagedMap.TryRemove(__Instance, out __dummy);
if (disposing)
global::Std.__1.BasicString.__Internal.dtorc__N_std_N___1_S_basic_string__C___N_std_N___1_S_char_traits__C___N_std_N___1_S_allocator__C_0((__Instance + __PointerAdjustment));
{
var ___CharT = typeof(_CharT);
var ___Traits = typeof(_Traits);
var ___Allocator = typeof(_Allocator);
if (___CharT.IsAssignableFrom(typeof(sbyte)) && ___Traits.IsAssignableFrom(typeof(global::Std.__1.CharTraits<sbyte>)) && ___Allocator.IsAssignableFrom(typeof(global::Std.__1.Allocator<sbyte>)))
{
global::Std.__1.BasicString.__Internal.dtorc__N_std_N___1_S_basic_string__C___N_std_N___1_S_char_traits__C___N_std_N___1_S_allocator__C((__Instance + __PointerAdjustment));
return;
}
throw new global::System.InvalidOperationException();
}
if (__ownsNativeInstance)
Marshal.FreeHGlobal(__Instance);
__Instance = IntPtr.Zero;
}
public string CStr
{
get
{
var __ret = global::Std.__1.BasicString.__Internal.CStrc__N_std_N___1_S_basic_string__C___N_std_N___1_S_char_traits__C___N_std_N___1_S_allocator__C((__Instance + __PointerAdjustment));
return Marshal.PtrToStringAnsi(__ret);
}
}
}
public unsafe partial class Rep
{
[StructLayout(LayoutKind.Explicit, Size = 24)]
public partial struct __Internal
{
[FieldOffset(0)]
internal global::Std.__1.BasicString.Rep._.__Internal _;
}
}
public unsafe partial class Long
{
[StructLayout(LayoutKind.Explicit, Size = 24)]
public partial struct __Internal
{
[FieldOffset(0)]
internal ulong __cap_;
[FieldOffset(8)]
internal ulong __size_;
[FieldOffset(16)]
internal global::System.IntPtr __data_;
}
}
public unsafe partial class Short
{
[StructLayout(LayoutKind.Explicit, Size = 24)]
public partial struct __Internal
{
[FieldOffset(0)]
internal global::Std.__1.BasicString.Short._.__Internal _;
[FieldOffset(1)]
internal fixed sbyte __data_[23];
}
}
public unsafe partial class Raw
{
[StructLayout(LayoutKind.Explicit, Size = 24)]
public partial struct __Internal
{
[FieldOffset(0)]
internal fixed ulong __words[3];
}
}
public unsafe partial struct Ulx
{
[StructLayout(LayoutKind.Explicit, Size = 24)]
public partial struct __Internal
{
[FieldOffset(0)]
internal global::Std.__1.BasicString.Long.__Internal __lx;
[FieldOffset(0)]
internal global::Std.__1.BasicString.Short.__Internal __lxx;
}
}
}
}

2196
src/CppParser/Bindings/CSharp/x86_64-linux-gnu-cxx11abi/CppSharp.CppParser.cs

File diff suppressed because it is too large Load Diff

3
src/CppParser/Bindings/CSharp/x86_64-linux-gnu-cxx11abi/Std-symbols.cpp

@ -1,6 +1,7 @@ @@ -1,6 +1,7 @@
#include <string>
template std::allocator<char>::allocator();
template std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>::basic_string(const char*, const std::allocator<char>&);
template std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>::~basic_string();
template const char* std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>::c_str() const noexcept;
template std::allocator<char>::allocator();

238
src/CppParser/Bindings/CSharp/x86_64-linux-gnu-cxx11abi/Std.cs

@ -39,7 +39,7 @@ namespace Std @@ -39,7 +39,7 @@ namespace Std
namespace Std
{
public unsafe partial class Allocator : IDisposable
namespace Allocator
{
[StructLayout(LayoutKind.Explicit, Size = 0)]
public unsafe partial struct __Internal
@ -47,30 +47,33 @@ namespace Std @@ -47,30 +47,33 @@ namespace Std
[SuppressUnmanagedCodeSecurity]
[DllImport("Std-symbols", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="_ZNSaIcEC2Ev")]
internal static extern void ctorc__N_std_S_allocator__C_0(global::System.IntPtr instance);
internal static extern void ctorc__N_std_S_allocator__C(global::System.IntPtr instance);
[SuppressUnmanagedCodeSecurity]
[DllImport("Std-symbols", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="_ZNSaIcED2Ev")]
internal static extern void dtorc__N_std_S_allocator__C(global::System.IntPtr instance);
}
}
public unsafe partial class Allocator<_Tp> : IDisposable
{
public global::System.IntPtr __Instance { get; protected set; }
protected int __PointerAdjustment;
internal static readonly global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::Std.Allocator> NativeToManagedMap = new global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::Std.Allocator>();
internal static readonly global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::Std.Allocator<_Tp>> NativeToManagedMap = new global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::Std.Allocator<_Tp>>();
protected void*[] __OriginalVTables;
protected bool __ownsNativeInstance;
internal static global::Std.Allocator __CreateInstance(global::System.IntPtr native, bool skipVTables = false)
internal static global::Std.Allocator<_Tp> __CreateInstance(global::System.IntPtr native, bool skipVTables = false)
{
return new global::Std.Allocator(native.ToPointer(), skipVTables);
return new global::Std.Allocator<_Tp>(native.ToPointer(), skipVTables);
}
internal static global::Std.Allocator __CreateInstance(global::Std.Allocator.__Internal native, bool skipVTables = false)
internal static global::Std.Allocator<_Tp> __CreateInstance(global::Std.Allocator.__Internal native, bool skipVTables = false)
{
return new global::Std.Allocator(native, skipVTables);
return new global::Std.Allocator<_Tp>(native, skipVTables);
}
private static void* __CopyValue(global::Std.Allocator.__Internal native)
@ -96,10 +99,16 @@ namespace Std @@ -96,10 +99,16 @@ namespace Std
public Allocator()
{
__Instance = Marshal.AllocHGlobal(sizeof(global::Std.Allocator.__Internal));
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
global::Std.Allocator.__Internal.ctorc__N_std_S_allocator__C_0((__Instance + __PointerAdjustment));
var ___Tp = typeof(_Tp);
if (___Tp.IsAssignableFrom(typeof(sbyte)))
{
__Instance = Marshal.AllocHGlobal(sizeof(global::Std.Allocator.__Internal));
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
global::Std.Allocator.__Internal.ctorc__N_std_S_allocator__C((__Instance + __PointerAdjustment));
return;
}
throw new global::System.InvalidOperationException();
}
public void Dispose()
@ -111,10 +120,18 @@ namespace Std @@ -111,10 +120,18 @@ namespace Std
{
if (__Instance == IntPtr.Zero)
return;
global::Std.Allocator __dummy;
global::Std.Allocator<_Tp> __dummy;
NativeToManagedMap.TryRemove(__Instance, out __dummy);
if (disposing)
global::Std.Allocator.__Internal.dtorc__N_std_S_allocator__C((__Instance + __PointerAdjustment));
{
var ___Tp = typeof(_Tp);
if (___Tp.IsAssignableFrom(typeof(sbyte)))
{
global::Std.Allocator.__Internal.dtorc__N_std_S_allocator__C((__Instance + __PointerAdjustment));
return;
}
throw new global::System.InvalidOperationException();
}
if (__ownsNativeInstance)
Marshal.FreeHGlobal(__Instance);
__Instance = IntPtr.Zero;
@ -344,6 +361,71 @@ public unsafe partial class MbstateT @@ -344,6 +361,71 @@ public unsafe partial class MbstateT
namespace Std
{
namespace CharTraits
{
[StructLayout(LayoutKind.Explicit, Size = 0)]
public unsafe partial struct __Internal
{
}
}
public unsafe partial class CharTraits<_CharT> : IDisposable
{
public global::System.IntPtr __Instance { get; protected set; }
protected int __PointerAdjustment;
internal static readonly global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::Std.CharTraits<_CharT>> NativeToManagedMap = new global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::Std.CharTraits<_CharT>>();
protected void*[] __OriginalVTables;
protected bool __ownsNativeInstance;
internal static global::Std.CharTraits<_CharT> __CreateInstance(global::System.IntPtr native, bool skipVTables = false)
{
return new global::Std.CharTraits<_CharT>(native.ToPointer(), skipVTables);
}
internal static global::Std.CharTraits<_CharT> __CreateInstance(global::Std.CharTraits.__Internal native, bool skipVTables = false)
{
return new global::Std.CharTraits<_CharT>(native, skipVTables);
}
private static void* __CopyValue(global::Std.CharTraits.__Internal native)
{
var ret = Marshal.AllocHGlobal(sizeof(global::Std.CharTraits.__Internal));
*(global::Std.CharTraits.__Internal*) ret = native;
return ret.ToPointer();
}
private CharTraits(global::Std.CharTraits.__Internal native, bool skipVTables = false)
: this(__CopyValue(native), skipVTables)
{
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
}
protected CharTraits(void* native, bool skipVTables = false)
{
if (native == null)
return;
__Instance = new global::System.IntPtr(native);
}
public void Dispose()
{
Dispose(disposing: true);
}
public virtual void Dispose(bool disposing)
{
if (__Instance == IntPtr.Zero)
return;
global::Std.CharTraits<_CharT> __dummy;
NativeToManagedMap.TryRemove(__Instance, out __dummy);
if (__ownsNativeInstance)
Marshal.FreeHGlobal(__Instance);
__Instance = IntPtr.Zero;
}
}
}
namespace Std
@ -576,7 +658,46 @@ namespace Std @@ -576,7 +658,46 @@ namespace Std
{
namespace Cxx11
{
public unsafe partial class BasicString : IDisposable
public unsafe static partial class BasicStringExtensions
{
[StructLayout(LayoutKind.Explicit, Size = 0)]
public partial struct __Internal
{
[SuppressUnmanagedCodeSecurity]
[DllImport("Std-symbols", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2EPKcRKS3_")]
internal static extern global::System.IntPtr BasicString(global::System.IntPtr instance, [MarshalAs(UnmanagedType.LPStr)] string __s, global::System.IntPtr __a);
[SuppressUnmanagedCodeSecurity]
[DllImport("Std-symbols", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv")]
internal static extern global::System.IntPtr CStr(global::System.IntPtr instance);
}
public static global::Std.Cxx11.BasicString<sbyte, global::Std.CharTraits<sbyte>, global::Std.Allocator<sbyte>> BasicString(string __s, global::Std.Allocator<sbyte> __a)
{
if (ReferenceEquals(__a, null))
throw new global::System.ArgumentNullException("__a", "Cannot be null because it is a C++ reference (&).");
var __arg1 = __a.__Instance;
var __ret = Marshal.AllocHGlobal(32);
__Internal.BasicString(__ret, __s, __arg1);
global::Std.Cxx11.BasicString<sbyte, global::Std.CharTraits<sbyte>, global::Std.Allocator<sbyte>> __result0;
if (__ret == IntPtr.Zero) __result0 = null;
else if (global::Std.Cxx11.BasicString<sbyte, global::Std.CharTraits<sbyte>, global::Std.Allocator<sbyte>>.NativeToManagedMap.ContainsKey(__ret))
__result0 = (global::Std.Cxx11.BasicString<sbyte, global::Std.CharTraits<sbyte>, global::Std.Allocator<sbyte>>) global::Std.Cxx11.BasicString<sbyte, global::Std.CharTraits<sbyte>, global::Std.Allocator<sbyte>>.NativeToManagedMap[__ret];
else __result0 = global::Std.Cxx11.BasicString<sbyte, global::Std.CharTraits<sbyte>, global::Std.Allocator<sbyte>>.__CreateInstance(__ret);
return __result0;
}
public static string CStr(this global::Std.Cxx11.BasicString<sbyte, global::Std.CharTraits<sbyte>, global::Std.Allocator<sbyte>> @this)
{
var __arg0 = ReferenceEquals(@this, null) ? global::System.IntPtr.Zero : @this.__Instance;
var __ret = __Internal.CStr(__arg0);
return Marshal.PtrToStringAnsi(__ret);
}
}
namespace BasicString
{
[StructLayout(LayoutKind.Explicit, Size = 32)]
public unsafe partial struct __Internal
@ -590,15 +711,10 @@ namespace Std @@ -590,15 +711,10 @@ namespace Std
[FieldOffset(16)]
internal global::Std.Cxx11.BasicString._.__Internal _;
[SuppressUnmanagedCodeSecurity]
[DllImport("Std-symbols", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2EPKcRKS3_")]
internal static extern void ctorc__N_std_N___cxx11_S_basic_string__C___N_std_S_char_traits__C___N_std_S_allocator__C_0(global::System.IntPtr instance, [MarshalAs(UnmanagedType.LPStr)] string __s, global::System.IntPtr __a);
[SuppressUnmanagedCodeSecurity]
[DllImport("Std-symbols", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev")]
internal static extern void dtorc__N_std_N___cxx11_S_basic_string__C___N_std_S_char_traits__C___N_std_S_allocator__C_0(global::System.IntPtr instance);
internal static extern void dtorc__N_std_N___cxx11_S_basic_string__C___N_std_S_char_traits__C___N_std_S_allocator__C(global::System.IntPtr instance);
[SuppressUnmanagedCodeSecurity]
[DllImport("Std-symbols", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
@ -606,10 +722,6 @@ namespace Std @@ -606,10 +722,6 @@ namespace Std
internal static extern global::System.IntPtr CStrc__N_std_N___cxx11_S_basic_string__C___N_std_S_char_traits__C___N_std_S_allocator__C(global::System.IntPtr instance);
}
internal enum S_localCapacity : uint
{
S_localCapacity = 15
}
public unsafe partial class AllocHider
{
@ -619,6 +731,7 @@ namespace Std @@ -619,6 +731,7 @@ namespace Std
[FieldOffset(0)]
internal global::System.IntPtr _M_p;
}
}
public unsafe partial struct _
@ -633,23 +746,31 @@ namespace Std @@ -633,23 +746,31 @@ namespace Std
internal ulong _M_allocated_capacity;
}
}
}
public unsafe partial class BasicString<_CharT, _Traits, _Alloc> : IDisposable
{
internal enum S_localCapacity
{
S_localCapacity = 0
}
public global::System.IntPtr __Instance { get; protected set; }
protected int __PointerAdjustment;
internal static readonly global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::Std.Cxx11.BasicString> NativeToManagedMap = new global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::Std.Cxx11.BasicString>();
internal static readonly global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::Std.Cxx11.BasicString<_CharT, _Traits, _Alloc>> NativeToManagedMap = new global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::Std.Cxx11.BasicString<_CharT, _Traits, _Alloc>>();
protected void*[] __OriginalVTables;
protected bool __ownsNativeInstance;
internal static global::Std.Cxx11.BasicString __CreateInstance(global::System.IntPtr native, bool skipVTables = false)
internal static global::Std.Cxx11.BasicString<_CharT, _Traits, _Alloc> __CreateInstance(global::System.IntPtr native, bool skipVTables = false)
{
return new global::Std.Cxx11.BasicString(native.ToPointer(), skipVTables);
return new global::Std.Cxx11.BasicString<_CharT, _Traits, _Alloc>(native.ToPointer(), skipVTables);
}
internal static global::Std.Cxx11.BasicString __CreateInstance(global::Std.Cxx11.BasicString.__Internal native, bool skipVTables = false)
internal static global::Std.Cxx11.BasicString<_CharT, _Traits, _Alloc> __CreateInstance(global::Std.Cxx11.BasicString.__Internal native, bool skipVTables = false)
{
return new global::Std.Cxx11.BasicString(native, skipVTables);
return new global::Std.Cxx11.BasicString<_CharT, _Traits, _Alloc>(native, skipVTables);
}
private static void* __CopyValue(global::Std.Cxx11.BasicString.__Internal native)
@ -673,17 +794,6 @@ namespace Std @@ -673,17 +794,6 @@ namespace Std
__Instance = new global::System.IntPtr(native);
}
public BasicString(string __s, global::Std.Allocator __a)
{
__Instance = Marshal.AllocHGlobal(sizeof(global::Std.Cxx11.BasicString.__Internal));
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
if (ReferenceEquals(__a, null))
throw new global::System.ArgumentNullException("__a", "Cannot be null because it is a C++ reference (&).");
var __arg1 = ((global::Std.Allocator) (object) __a).__Instance;
global::Std.Cxx11.BasicString.__Internal.ctorc__N_std_N___cxx11_S_basic_string__C___N_std_S_char_traits__C___N_std_S_allocator__C_0((__Instance + __PointerAdjustment), __s, __arg1);
}
public void Dispose()
{
Dispose(disposing: true);
@ -693,48 +803,24 @@ namespace Std @@ -693,48 +803,24 @@ namespace Std
{
if (__Instance == IntPtr.Zero)
return;
global::Std.Cxx11.BasicString __dummy;
global::Std.Cxx11.BasicString<_CharT, _Traits, _Alloc> __dummy;
NativeToManagedMap.TryRemove(__Instance, out __dummy);
if (disposing)
global::Std.Cxx11.BasicString.__Internal.dtorc__N_std_N___cxx11_S_basic_string__C___N_std_S_char_traits__C___N_std_S_allocator__C_0((__Instance + __PointerAdjustment));
{
var ___CharT = typeof(_CharT);
var ___Traits = typeof(_Traits);
var ___Alloc = typeof(_Alloc);
if (___CharT.IsAssignableFrom(typeof(sbyte)) && ___Traits.IsAssignableFrom(typeof(global::Std.CharTraits<sbyte>)) && ___Alloc.IsAssignableFrom(typeof(global::Std.Allocator<sbyte>)))
{
global::Std.Cxx11.BasicString.__Internal.dtorc__N_std_N___cxx11_S_basic_string__C___N_std_S_char_traits__C___N_std_S_allocator__C((__Instance + __PointerAdjustment));
return;
}
throw new global::System.InvalidOperationException();
}
if (__ownsNativeInstance)
Marshal.FreeHGlobal(__Instance);
__Instance = IntPtr.Zero;
}
public string CStr
{
get
{
var __ret = global::Std.Cxx11.BasicString.__Internal.CStrc__N_std_N___cxx11_S_basic_string__C___N_std_S_char_traits__C___N_std_S_allocator__C((__Instance + __PointerAdjustment));
return Marshal.PtrToStringAnsi(__ret);
}
}
}
public unsafe partial class AllocHider
{
[StructLayout(LayoutKind.Explicit, Size = 8)]
public partial struct __Internal
{
[FieldOffset(0)]
internal global::System.IntPtr _M_p;
}
}
public unsafe partial struct _
{
[StructLayout(LayoutKind.Explicit, Size = 16)]
public partial struct __Internal
{
[FieldOffset(0)]
internal fixed sbyte _M_local_buf[16];
[FieldOffset(0)]
internal ulong _M_allocated_capacity;
}
}
}
}

2196
src/CppParser/Bindings/CSharp/x86_64-linux-gnu/CppSharp.CppParser.cs

File diff suppressed because it is too large Load Diff

3
src/CppParser/Bindings/CSharp/x86_64-linux-gnu/Std-symbols.cpp

@ -1,6 +1,7 @@ @@ -1,6 +1,7 @@
#include <string>
template std::allocator<char>::allocator();
template std::basic_string<char, std::char_traits<char>, std::allocator<char>>::basic_string(const char*, const std::allocator<char>&);
template std::basic_string<char, std::char_traits<char>, std::allocator<char>>::~basic_string() noexcept;
template const char* std::basic_string<char, std::char_traits<char>, std::allocator<char>>::c_str() const noexcept;
template std::allocator<char>::allocator();

269
src/CppParser/Bindings/CSharp/x86_64-linux-gnu/Std.cs

@ -39,7 +39,7 @@ namespace Std @@ -39,7 +39,7 @@ namespace Std
namespace Std
{
public unsafe partial class Allocator : IDisposable
namespace Allocator
{
[StructLayout(LayoutKind.Explicit, Size = 0)]
public unsafe partial struct __Internal
@ -47,7 +47,7 @@ namespace Std @@ -47,7 +47,7 @@ namespace Std
[SuppressUnmanagedCodeSecurity]
[DllImport("Std-symbols", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="_ZNSaIcEC2Ev")]
internal static extern void ctorc__N_std_S_allocator__C_0(global::System.IntPtr instance);
internal static extern void ctorc__N_std_S_allocator__C(global::System.IntPtr instance);
[SuppressUnmanagedCodeSecurity]
[DllImport("Std-symbols", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
@ -55,22 +55,34 @@ namespace Std @@ -55,22 +55,34 @@ namespace Std
internal static extern void dtorc__N_std_S_allocator__C(global::System.IntPtr instance);
}
public unsafe partial class Rebind
{
[StructLayout(LayoutKind.Explicit, Size = 0)]
public unsafe partial struct __Internal
{
}
}
}
public unsafe partial class Allocator<_Tp> : IDisposable
{
public global::System.IntPtr __Instance { get; protected set; }
protected int __PointerAdjustment;
internal static readonly global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::Std.Allocator> NativeToManagedMap = new global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::Std.Allocator>();
internal static readonly global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::Std.Allocator<_Tp>> NativeToManagedMap = new global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::Std.Allocator<_Tp>>();
protected void*[] __OriginalVTables;
protected bool __ownsNativeInstance;
internal static global::Std.Allocator __CreateInstance(global::System.IntPtr native, bool skipVTables = false)
internal static global::Std.Allocator<_Tp> __CreateInstance(global::System.IntPtr native, bool skipVTables = false)
{
return new global::Std.Allocator(native.ToPointer(), skipVTables);
return new global::Std.Allocator<_Tp>(native.ToPointer(), skipVTables);
}
internal static global::Std.Allocator __CreateInstance(global::Std.Allocator.__Internal native, bool skipVTables = false)
internal static global::Std.Allocator<_Tp> __CreateInstance(global::Std.Allocator.__Internal native, bool skipVTables = false)
{
return new global::Std.Allocator(native, skipVTables);
return new global::Std.Allocator<_Tp>(native, skipVTables);
}
private static void* __CopyValue(global::Std.Allocator.__Internal native)
@ -96,10 +108,16 @@ namespace Std @@ -96,10 +108,16 @@ namespace Std
public Allocator()
{
__Instance = Marshal.AllocHGlobal(sizeof(global::Std.Allocator.__Internal));
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
global::Std.Allocator.__Internal.ctorc__N_std_S_allocator__C_0((__Instance + __PointerAdjustment));
var ___Tp = typeof(_Tp);
if (___Tp.IsAssignableFrom(typeof(sbyte)))
{
__Instance = Marshal.AllocHGlobal(sizeof(global::Std.Allocator.__Internal));
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
global::Std.Allocator.__Internal.ctorc__N_std_S_allocator__C((__Instance + __PointerAdjustment));
return;
}
throw new global::System.InvalidOperationException();
}
public void Dispose()
@ -111,24 +129,23 @@ namespace Std @@ -111,24 +129,23 @@ namespace Std
{
if (__Instance == IntPtr.Zero)
return;
global::Std.Allocator __dummy;
global::Std.Allocator<_Tp> __dummy;
NativeToManagedMap.TryRemove(__Instance, out __dummy);
if (disposing)
global::Std.Allocator.__Internal.dtorc__N_std_S_allocator__C((__Instance + __PointerAdjustment));
{
var ___Tp = typeof(_Tp);
if (___Tp.IsAssignableFrom(typeof(sbyte)))
{
global::Std.Allocator.__Internal.dtorc__N_std_S_allocator__C((__Instance + __PointerAdjustment));
return;
}
throw new global::System.InvalidOperationException();
}
if (__ownsNativeInstance)
Marshal.FreeHGlobal(__Instance);
__Instance = IntPtr.Zero;
}
}
public unsafe partial class Rebind
{
[StructLayout(LayoutKind.Explicit, Size = 0)]
public unsafe partial struct __Internal
{
}
}
}
namespace Std
@ -346,6 +363,71 @@ public unsafe partial class MbstateT @@ -346,6 +363,71 @@ public unsafe partial class MbstateT
namespace Std
{
namespace CharTraits
{
[StructLayout(LayoutKind.Explicit, Size = 0)]
public unsafe partial struct __Internal
{
}
}
public unsafe partial class CharTraits<_CharT> : IDisposable
{
public global::System.IntPtr __Instance { get; protected set; }
protected int __PointerAdjustment;
internal static readonly global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::Std.CharTraits<_CharT>> NativeToManagedMap = new global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::Std.CharTraits<_CharT>>();
protected void*[] __OriginalVTables;
protected bool __ownsNativeInstance;
internal static global::Std.CharTraits<_CharT> __CreateInstance(global::System.IntPtr native, bool skipVTables = false)
{
return new global::Std.CharTraits<_CharT>(native.ToPointer(), skipVTables);
}
internal static global::Std.CharTraits<_CharT> __CreateInstance(global::Std.CharTraits.__Internal native, bool skipVTables = false)
{
return new global::Std.CharTraits<_CharT>(native, skipVTables);
}
private static void* __CopyValue(global::Std.CharTraits.__Internal native)
{
var ret = Marshal.AllocHGlobal(sizeof(global::Std.CharTraits.__Internal));
*(global::Std.CharTraits.__Internal*) ret = native;
return ret.ToPointer();
}
private CharTraits(global::Std.CharTraits.__Internal native, bool skipVTables = false)
: this(__CopyValue(native), skipVTables)
{
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
}
protected CharTraits(void* native, bool skipVTables = false)
{
if (native == null)
return;
__Instance = new global::System.IntPtr(native);
}
public void Dispose()
{
Dispose(disposing: true);
}
public virtual void Dispose(bool disposing)
{
if (__Instance == IntPtr.Zero)
return;
global::Std.CharTraits<_CharT> __dummy;
NativeToManagedMap.TryRemove(__Instance, out __dummy);
if (__ownsNativeInstance)
Marshal.FreeHGlobal(__Instance);
__Instance = IntPtr.Zero;
}
}
}
public unsafe partial class Timespec
@ -568,7 +650,46 @@ public unsafe partial class PthreadUnwindBufT @@ -568,7 +650,46 @@ public unsafe partial class PthreadUnwindBufT
namespace Std
{
public unsafe partial class BasicString : IDisposable
public unsafe static partial class BasicStringExtensions
{
[StructLayout(LayoutKind.Explicit, Size = 0)]
public partial struct __Internal
{
[SuppressUnmanagedCodeSecurity]
[DllImport("Std-symbols", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="_ZNSsC2EPKcRKSaIcE")]
internal static extern global::System.IntPtr BasicString(global::System.IntPtr instance, [MarshalAs(UnmanagedType.LPStr)] string __s, global::System.IntPtr __a);
[SuppressUnmanagedCodeSecurity]
[DllImport("Std-symbols", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="_ZNKSs5c_strEv")]
internal static extern global::System.IntPtr CStr(global::System.IntPtr instance);
}
public static global::Std.BasicString<sbyte, global::Std.CharTraits<sbyte>, global::Std.Allocator<sbyte>> BasicString(string __s, global::Std.Allocator<sbyte> __a)
{
if (ReferenceEquals(__a, null))
throw new global::System.ArgumentNullException("__a", "Cannot be null because it is a C++ reference (&).");
var __arg1 = __a.__Instance;
var __ret = Marshal.AllocHGlobal(8);
__Internal.BasicString(__ret, __s, __arg1);
global::Std.BasicString<sbyte, global::Std.CharTraits<sbyte>, global::Std.Allocator<sbyte>> __result0;
if (__ret == IntPtr.Zero) __result0 = null;
else if (global::Std.BasicString<sbyte, global::Std.CharTraits<sbyte>, global::Std.Allocator<sbyte>>.NativeToManagedMap.ContainsKey(__ret))
__result0 = (global::Std.BasicString<sbyte, global::Std.CharTraits<sbyte>, global::Std.Allocator<sbyte>>) global::Std.BasicString<sbyte, global::Std.CharTraits<sbyte>, global::Std.Allocator<sbyte>>.NativeToManagedMap[__ret];
else __result0 = global::Std.BasicString<sbyte, global::Std.CharTraits<sbyte>, global::Std.Allocator<sbyte>>.__CreateInstance(__ret);
return __result0;
}
public static string CStr(this global::Std.BasicString<sbyte, global::Std.CharTraits<sbyte>, global::Std.Allocator<sbyte>> @this)
{
var __arg0 = ReferenceEquals(@this, null) ? global::System.IntPtr.Zero : @this.__Instance;
var __ret = __Internal.CStr(__arg0);
return Marshal.PtrToStringAnsi(__ret);
}
}
namespace BasicString
{
[StructLayout(LayoutKind.Explicit, Size = 8)]
public unsafe partial struct __Internal
@ -576,15 +697,10 @@ namespace Std @@ -576,15 +697,10 @@ namespace Std
[FieldOffset(0)]
internal global::Std.BasicString.AllocHider.__Internal _M_dataplus;
[SuppressUnmanagedCodeSecurity]
[DllImport("Std-symbols", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="_ZNSsC2EPKcRKSaIcE")]
internal static extern void ctorc__N_std_S_basic_string__C___N_std_S_char_traits__C___N_std_S_allocator__C_0(global::System.IntPtr instance, [MarshalAs(UnmanagedType.LPStr)] string __s, global::System.IntPtr __a);
[SuppressUnmanagedCodeSecurity]
[DllImport("Std-symbols", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="_ZNSsD2Ev")]
internal static extern void dtorc__N_std_S_basic_string__C___N_std_S_char_traits__C___N_std_S_allocator__C_0(global::System.IntPtr instance);
internal static extern void dtorc__N_std_S_basic_string__C___N_std_S_char_traits__C___N_std_S_allocator__C(global::System.IntPtr instance);
[SuppressUnmanagedCodeSecurity]
[DllImport("Std-symbols", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
@ -592,6 +708,7 @@ namespace Std @@ -592,6 +708,7 @@ namespace Std
internal static extern global::System.IntPtr CStrc__N_std_S_basic_string__C___N_std_S_char_traits__C___N_std_S_allocator__C(global::System.IntPtr instance);
}
public unsafe partial class AllocHider
{
[StructLayout(LayoutKind.Explicit, Size = 8)]
@ -600,6 +717,7 @@ namespace Std @@ -600,6 +717,7 @@ namespace Std
[FieldOffset(0)]
internal global::System.IntPtr _M_p;
}
}
public unsafe partial class RepBase
@ -616,6 +734,7 @@ namespace Std @@ -616,6 +734,7 @@ namespace Std
[FieldOffset(16)]
internal int _M_refcount;
}
}
public unsafe partial class Rep
@ -633,23 +752,26 @@ namespace Std @@ -633,23 +752,26 @@ namespace Std
internal int _M_refcount;
}
}
}
public unsafe partial class BasicString<_CharT, _Traits, _Alloc> : IDisposable
{
public global::System.IntPtr __Instance { get; protected set; }
protected int __PointerAdjustment;
internal static readonly global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::Std.BasicString> NativeToManagedMap = new global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::Std.BasicString>();
internal static readonly global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::Std.BasicString<_CharT, _Traits, _Alloc>> NativeToManagedMap = new global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::Std.BasicString<_CharT, _Traits, _Alloc>>();
protected void*[] __OriginalVTables;
protected bool __ownsNativeInstance;
internal static global::Std.BasicString __CreateInstance(global::System.IntPtr native, bool skipVTables = false)
internal static global::Std.BasicString<_CharT, _Traits, _Alloc> __CreateInstance(global::System.IntPtr native, bool skipVTables = false)
{
return new global::Std.BasicString(native.ToPointer(), skipVTables);
return new global::Std.BasicString<_CharT, _Traits, _Alloc>(native.ToPointer(), skipVTables);
}
internal static global::Std.BasicString __CreateInstance(global::Std.BasicString.__Internal native, bool skipVTables = false)
internal static global::Std.BasicString<_CharT, _Traits, _Alloc> __CreateInstance(global::Std.BasicString.__Internal native, bool skipVTables = false)
{
return new global::Std.BasicString(native, skipVTables);
return new global::Std.BasicString<_CharT, _Traits, _Alloc>(native, skipVTables);
}
private static void* __CopyValue(global::Std.BasicString.__Internal native)
@ -673,17 +795,6 @@ namespace Std @@ -673,17 +795,6 @@ namespace Std
__Instance = new global::System.IntPtr(native);
}
public BasicString(string __s, global::Std.Allocator __a)
{
__Instance = Marshal.AllocHGlobal(sizeof(global::Std.BasicString.__Internal));
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
if (ReferenceEquals(__a, null))
throw new global::System.ArgumentNullException("__a", "Cannot be null because it is a C++ reference (&).");
var __arg1 = ((global::Std.Allocator) (object) __a).__Instance;
global::Std.BasicString.__Internal.ctorc__N_std_S_basic_string__C___N_std_S_char_traits__C___N_std_S_allocator__C_0((__Instance + __PointerAdjustment), __s, __arg1);
}
public void Dispose()
{
Dispose(disposing: true);
@ -693,68 +804,24 @@ namespace Std @@ -693,68 +804,24 @@ namespace Std
{
if (__Instance == IntPtr.Zero)
return;
global::Std.BasicString __dummy;
global::Std.BasicString<_CharT, _Traits, _Alloc> __dummy;
NativeToManagedMap.TryRemove(__Instance, out __dummy);
if (disposing)
global::Std.BasicString.__Internal.dtorc__N_std_S_basic_string__C___N_std_S_char_traits__C___N_std_S_allocator__C_0((__Instance + __PointerAdjustment));
{
var ___CharT = typeof(_CharT);
var ___Traits = typeof(_Traits);
var ___Alloc = typeof(_Alloc);
if (___CharT.IsAssignableFrom(typeof(sbyte)) && ___Traits.IsAssignableFrom(typeof(global::Std.CharTraits<sbyte>)) && ___Alloc.IsAssignableFrom(typeof(global::Std.Allocator<sbyte>)))
{
global::Std.BasicString.__Internal.dtorc__N_std_S_basic_string__C___N_std_S_char_traits__C___N_std_S_allocator__C((__Instance + __PointerAdjustment));
return;
}
throw new global::System.InvalidOperationException();
}
if (__ownsNativeInstance)
Marshal.FreeHGlobal(__Instance);
__Instance = IntPtr.Zero;
}
public string CStr
{
get
{
var __ret = global::Std.BasicString.__Internal.CStrc__N_std_S_basic_string__C___N_std_S_char_traits__C___N_std_S_allocator__C((__Instance + __PointerAdjustment));
return Marshal.PtrToStringAnsi(__ret);
}
}
}
public unsafe partial class AllocHider
{
[StructLayout(LayoutKind.Explicit, Size = 8)]
public partial struct __Internal
{
[FieldOffset(0)]
internal global::System.IntPtr _M_p;
}
}
public unsafe partial class RepBase
{
[StructLayout(LayoutKind.Explicit, Size = 24)]
public partial struct __Internal
{
[FieldOffset(0)]
internal ulong _M_length;
[FieldOffset(8)]
internal ulong _M_capacity;
[FieldOffset(16)]
internal int _M_refcount;
}
}
public unsafe partial class Rep
{
[StructLayout(LayoutKind.Explicit, Size = 24)]
public partial struct __Internal
{
[FieldOffset(0)]
internal ulong _M_length;
[FieldOffset(8)]
internal ulong _M_capacity;
[FieldOffset(16)]
internal int _M_refcount;
}
}
}

2196
src/CppParser/Bindings/CSharp/x86_64-pc-win32-msvc/CppSharp.CppParser.cs

File diff suppressed because it is too large Load Diff

3
src/CppParser/Bindings/CSharp/x86_64-pc-win32-msvc/Std-symbols.cpp

@ -1,6 +1,7 @@ @@ -1,6 +1,7 @@
#include <string>
template __declspec(dllexport) std::allocator<char>::allocator() noexcept;
template __declspec(dllexport) std::basic_string<char, std::char_traits<char>, std::allocator<char>>::basic_string(const char*, const std::allocator<char>&);
template __declspec(dllexport) std::basic_string<char, std::char_traits<char>, std::allocator<char>>::~basic_string() noexcept;
template __declspec(dllexport) const char* std::basic_string<char, std::char_traits<char>, std::allocator<char>>::c_str() const noexcept;
template __declspec(dllexport) std::allocator<char>::allocator() noexcept;

193
src/CppParser/Bindings/CSharp/x86_64-pc-win32-msvc/Std.cs

@ -57,6 +57,71 @@ public unsafe partial class StdExceptionData @@ -57,6 +57,71 @@ public unsafe partial class StdExceptionData
namespace Std
{
namespace CharTraits
{
[StructLayout(LayoutKind.Explicit, Size = 0)]
public unsafe partial struct __Internal
{
}
}
public unsafe partial class CharTraits<_Elem> : IDisposable
{
public global::System.IntPtr __Instance { get; protected set; }
protected int __PointerAdjustment;
internal static readonly global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::Std.CharTraits<_Elem>> NativeToManagedMap = new global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::Std.CharTraits<_Elem>>();
protected void*[] __OriginalVTables;
protected bool __ownsNativeInstance;
internal static global::Std.CharTraits<_Elem> __CreateInstance(global::System.IntPtr native, bool skipVTables = false)
{
return new global::Std.CharTraits<_Elem>(native.ToPointer(), skipVTables);
}
internal static global::Std.CharTraits<_Elem> __CreateInstance(global::Std.CharTraits.__Internal native, bool skipVTables = false)
{
return new global::Std.CharTraits<_Elem>(native, skipVTables);
}
private static void* __CopyValue(global::Std.CharTraits.__Internal native)
{
var ret = Marshal.AllocHGlobal(sizeof(global::Std.CharTraits.__Internal));
*(global::Std.CharTraits.__Internal*) ret = native;
return ret.ToPointer();
}
private CharTraits(global::Std.CharTraits.__Internal native, bool skipVTables = false)
: this(__CopyValue(native), skipVTables)
{
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
}
protected CharTraits(void* native, bool skipVTables = false)
{
if (native == null)
return;
__Instance = new global::System.IntPtr(native);
}
public void Dispose()
{
Dispose(disposing: true);
}
public virtual void Dispose(bool disposing)
{
if (__Instance == IntPtr.Zero)
return;
global::Std.CharTraits<_Elem> __dummy;
NativeToManagedMap.TryRemove(__Instance, out __dummy);
if (__ownsNativeInstance)
Marshal.FreeHGlobal(__Instance);
__Instance = IntPtr.Zero;
}
}
}
namespace Std
@ -395,7 +460,7 @@ namespace Std @@ -395,7 +460,7 @@ namespace Std
namespace Std
{
public unsafe partial class Allocator : IDisposable
namespace Allocator
{
[StructLayout(LayoutKind.Explicit, Size = 0)]
public unsafe partial struct __Internal
@ -403,25 +468,28 @@ namespace Std @@ -403,25 +468,28 @@ namespace Std
[SuppressUnmanagedCodeSecurity]
[DllImport("Std-symbols", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="??0?$allocator@D@std@@QEAA@XZ")]
internal static extern global::System.IntPtr ctorc__N_std_S_allocator__C_0(global::System.IntPtr instance);
internal static extern global::System.IntPtr ctorc__N_std_S_allocator__C(global::System.IntPtr instance);
}
}
public unsafe partial class Allocator<_Ty> : IDisposable
{
public global::System.IntPtr __Instance { get; protected set; }
protected int __PointerAdjustment;
internal static readonly global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::Std.Allocator> NativeToManagedMap = new global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::Std.Allocator>();
internal static readonly global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::Std.Allocator<_Ty>> NativeToManagedMap = new global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::Std.Allocator<_Ty>>();
protected void*[] __OriginalVTables;
protected bool __ownsNativeInstance;
internal static global::Std.Allocator __CreateInstance(global::System.IntPtr native, bool skipVTables = false)
internal static global::Std.Allocator<_Ty> __CreateInstance(global::System.IntPtr native, bool skipVTables = false)
{
return new global::Std.Allocator(native.ToPointer(), skipVTables);
return new global::Std.Allocator<_Ty>(native.ToPointer(), skipVTables);
}
internal static global::Std.Allocator __CreateInstance(global::Std.Allocator.__Internal native, bool skipVTables = false)
internal static global::Std.Allocator<_Ty> __CreateInstance(global::Std.Allocator.__Internal native, bool skipVTables = false)
{
return new global::Std.Allocator(native, skipVTables);
return new global::Std.Allocator<_Ty>(native, skipVTables);
}
private static void* __CopyValue(global::Std.Allocator.__Internal native)
@ -447,10 +515,16 @@ namespace Std @@ -447,10 +515,16 @@ namespace Std
public Allocator()
{
__Instance = Marshal.AllocHGlobal(sizeof(global::Std.Allocator.__Internal));
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
global::Std.Allocator.__Internal.ctorc__N_std_S_allocator__C_0((__Instance + __PointerAdjustment));
var ___Ty = typeof(_Ty);
if (___Ty.IsAssignableFrom(typeof(sbyte)))
{
__Instance = Marshal.AllocHGlobal(sizeof(global::Std.Allocator.__Internal));
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
global::Std.Allocator.__Internal.ctorc__N_std_S_allocator__C((__Instance + __PointerAdjustment));
return;
}
throw new global::System.InvalidOperationException();
}
public void Dispose()
@ -462,7 +536,7 @@ namespace Std @@ -462,7 +536,7 @@ namespace Std
{
if (__Instance == IntPtr.Zero)
return;
global::Std.Allocator __dummy;
global::Std.Allocator<_Ty> __dummy;
NativeToManagedMap.TryRemove(__Instance, out __dummy);
if (__ownsNativeInstance)
Marshal.FreeHGlobal(__Instance);
@ -487,7 +561,46 @@ namespace Std @@ -487,7 +561,46 @@ namespace Std
namespace Std
{
public unsafe partial class BasicString : IDisposable
public unsafe static partial class BasicStringExtensions
{
[StructLayout(LayoutKind.Explicit, Size = 0)]
public partial struct __Internal
{
[SuppressUnmanagedCodeSecurity]
[DllImport("Std-symbols", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@PEBDAEBV?$allocator@D@1@@Z")]
internal static extern global::System.IntPtr BasicString(global::System.IntPtr instance, [MarshalAs(UnmanagedType.LPStr)] string _Ptr, global::System.IntPtr _Al);
[SuppressUnmanagedCodeSecurity]
[DllImport("Std-symbols", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="?c_str@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBAPEBDXZ")]
internal static extern global::System.IntPtr CStr(global::System.IntPtr instance);
}
public static global::Std.BasicString<sbyte, global::Std.CharTraits<sbyte>, global::Std.Allocator<sbyte>> BasicString(string _Ptr, global::Std.Allocator<sbyte> _Al)
{
if (ReferenceEquals(_Al, null))
throw new global::System.ArgumentNullException("_Al", "Cannot be null because it is a C++ reference (&).");
var __arg1 = _Al.__Instance;
var __ret = Marshal.AllocHGlobal(32);
__Internal.BasicString(__ret, _Ptr, __arg1);
global::Std.BasicString<sbyte, global::Std.CharTraits<sbyte>, global::Std.Allocator<sbyte>> __result0;
if (__ret == IntPtr.Zero) __result0 = null;
else if (global::Std.BasicString<sbyte, global::Std.CharTraits<sbyte>, global::Std.Allocator<sbyte>>.NativeToManagedMap.ContainsKey(__ret))
__result0 = (global::Std.BasicString<sbyte, global::Std.CharTraits<sbyte>, global::Std.Allocator<sbyte>>) global::Std.BasicString<sbyte, global::Std.CharTraits<sbyte>, global::Std.Allocator<sbyte>>.NativeToManagedMap[__ret];
else __result0 = global::Std.BasicString<sbyte, global::Std.CharTraits<sbyte>, global::Std.Allocator<sbyte>>.__CreateInstance(__ret);
return __result0;
}
public static string CStr(this global::Std.BasicString<sbyte, global::Std.CharTraits<sbyte>, global::Std.Allocator<sbyte>> @this)
{
var __arg0 = ReferenceEquals(@this, null) ? global::System.IntPtr.Zero : @this.__Instance;
var __ret = __Internal.CStr(__arg0);
return Marshal.PtrToStringAnsi(__ret);
}
}
namespace BasicString
{
[StructLayout(LayoutKind.Explicit, Size = 32)]
public unsafe partial struct __Internal
@ -495,38 +608,36 @@ namespace Std @@ -495,38 +608,36 @@ namespace Std
[FieldOffset(0)]
internal global::Std.CompressedPair.__Internalc__N_std_S__Compressed_pair____N_std_S__Wrap_alloc____N_std_S_allocator__C___N_std_S__String_val____N_std_S__Simple_types__C_Vb1 _Mypair;
[SuppressUnmanagedCodeSecurity]
[DllImport("Std-symbols", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@PEBDAEBV?$allocator@D@1@@Z")]
internal static extern global::System.IntPtr ctorc__N_std_S_basic_string__C___N_std_S_char_traits__C___N_std_S_allocator__C_0(global::System.IntPtr instance, [MarshalAs(UnmanagedType.LPStr)] string _Ptr, global::System.IntPtr _Al);
[SuppressUnmanagedCodeSecurity]
[DllImport("Std-symbols", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@XZ")]
internal static extern void dtorc__N_std_S_basic_string__C___N_std_S_char_traits__C___N_std_S_allocator__C_0(global::System.IntPtr instance, int delete);
internal static extern void dtorc__N_std_S_basic_string__C___N_std_S_char_traits__C___N_std_S_allocator__C(global::System.IntPtr instance, int delete);
[SuppressUnmanagedCodeSecurity]
[DllImport("Std-symbols", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="?c_str@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBAPEBDXZ")]
internal static extern global::System.IntPtr CStrc__N_std_S_basic_string__C___N_std_S_char_traits__C___N_std_S_allocator__C(global::System.IntPtr instance);
}
}
public unsafe partial class BasicString<_Elem, _Traits, _Alloc> : IDisposable
{
public global::System.IntPtr __Instance { get; protected set; }
protected int __PointerAdjustment;
internal static readonly global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::Std.BasicString> NativeToManagedMap = new global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::Std.BasicString>();
internal static readonly global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::Std.BasicString<_Elem, _Traits, _Alloc>> NativeToManagedMap = new global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::Std.BasicString<_Elem, _Traits, _Alloc>>();
protected void*[] __OriginalVTables;
protected bool __ownsNativeInstance;
internal static global::Std.BasicString __CreateInstance(global::System.IntPtr native, bool skipVTables = false)
internal static global::Std.BasicString<_Elem, _Traits, _Alloc> __CreateInstance(global::System.IntPtr native, bool skipVTables = false)
{
return new global::Std.BasicString(native.ToPointer(), skipVTables);
return new global::Std.BasicString<_Elem, _Traits, _Alloc>(native.ToPointer(), skipVTables);
}
internal static global::Std.BasicString __CreateInstance(global::Std.BasicString.__Internal native, bool skipVTables = false)
internal static global::Std.BasicString<_Elem, _Traits, _Alloc> __CreateInstance(global::Std.BasicString.__Internal native, bool skipVTables = false)
{
return new global::Std.BasicString(native, skipVTables);
return new global::Std.BasicString<_Elem, _Traits, _Alloc>(native, skipVTables);
}
private static void* __CopyValue(global::Std.BasicString.__Internal native)
@ -550,17 +661,6 @@ namespace Std @@ -550,17 +661,6 @@ namespace Std
__Instance = new global::System.IntPtr(native);
}
public BasicString(string _Ptr, global::Std.Allocator _Al)
{
__Instance = Marshal.AllocHGlobal(sizeof(global::Std.BasicString.__Internal));
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
if (ReferenceEquals(_Al, null))
throw new global::System.ArgumentNullException("_Al", "Cannot be null because it is a C++ reference (&).");
var __arg1 = ((global::Std.Allocator) (object) _Al).__Instance;
global::Std.BasicString.__Internal.ctorc__N_std_S_basic_string__C___N_std_S_char_traits__C___N_std_S_allocator__C_0((__Instance + __PointerAdjustment), _Ptr, __arg1);
}
public void Dispose()
{
Dispose(disposing: true);
@ -570,23 +670,24 @@ namespace Std @@ -570,23 +670,24 @@ namespace Std
{
if (__Instance == IntPtr.Zero)
return;
global::Std.BasicString __dummy;
global::Std.BasicString<_Elem, _Traits, _Alloc> __dummy;
NativeToManagedMap.TryRemove(__Instance, out __dummy);
if (disposing)
global::Std.BasicString.__Internal.dtorc__N_std_S_basic_string__C___N_std_S_char_traits__C___N_std_S_allocator__C_0((__Instance + __PointerAdjustment), 0);
{
var ___Elem = typeof(_Elem);
var ___Traits = typeof(_Traits);
var ___Alloc = typeof(_Alloc);
if (___Elem.IsAssignableFrom(typeof(sbyte)) && ___Traits.IsAssignableFrom(typeof(global::Std.CharTraits<sbyte>)) && ___Alloc.IsAssignableFrom(typeof(global::Std.Allocator<sbyte>)))
{
global::Std.BasicString.__Internal.dtorc__N_std_S_basic_string__C___N_std_S_char_traits__C___N_std_S_allocator__C((__Instance + __PointerAdjustment), 0);
return;
}
throw new global::System.InvalidOperationException();
}
if (__ownsNativeInstance)
Marshal.FreeHGlobal(__Instance);
__Instance = IntPtr.Zero;
}
public string CStr
{
get
{
var __ret = global::Std.BasicString.__Internal.CStrc__N_std_S_basic_string__C___N_std_S_char_traits__C___N_std_S_allocator__C((__Instance + __PointerAdjustment));
return Marshal.PtrToStringAnsi(__ret);
}
}
}
namespace StringVal

Loading…
Cancel
Save