Browse Source

Added NativeDataSize property to the ICppMarshal interface.

pull/86/head
triton 12 years ago
parent
commit
71d9ba5761
  1. 6
      src/Generator/Generators/CSharp/CSharpTextTemplate.cs
  2. 5
      src/Runtime/Interfaces.cs

6
src/Generator/Generators/CSharp/CSharpTextTemplate.cs

@ -361,6 +361,12 @@ namespace CppSharp.Generators.CSharp
private void GenerateClassMarshals(Class @class) private void GenerateClassMarshals(Class @class)
{ {
WriteLine("int CppSharp.Runtime.ICppMarshal.NativeDataSize");
WriteStartBraceIndent();
WriteLine("get {{ return {0}; }}", @class.Layout.DataSize);
WriteCloseBraceIndent();
NewLine();
WriteLine("void CppSharp.Runtime.ICppMarshal.MarshalManagedToNative(global::System.IntPtr instance)"); WriteLine("void CppSharp.Runtime.ICppMarshal.MarshalManagedToNative(global::System.IntPtr instance)");
WriteStartBraceIndent(); WriteStartBraceIndent();
WriteCloseBraceIndent(); WriteCloseBraceIndent();

5
src/Runtime/Interfaces.cs

@ -25,6 +25,11 @@ namespace CppSharp.Runtime
{ {
public interface ICppMarshal public interface ICppMarshal
{ {
/// <summary>
/// Gets the native data size for the object.
/// </summary>
int NativeDataSize { get; }
/// <summary> /// <summary>
/// Converts the managed data to unmanaged data. /// Converts the managed data to unmanaged data.
/// </summary>/// /// </summary>///

Loading…
Cancel
Save