Skip to content
Permalink
Browse files

Add in missing namespaces

  • Loading branch information...
geographika committed Sep 30, 2018
1 parent 6734fb2 commit 85019eade54d36038935c204ef0975c3509cdfb7
Showing with 15 additions and 15 deletions.
  1. +6 −6 mapscript/csharp/csmodule.i
  2. +9 −9 mapscript/csharp/swig_csharp_extensions.i
@@ -138,7 +138,7 @@ inner exceptions. Otherwise the exception message will be concatenated*/
for (int cx = 0; cx < _ar.Length; cx++) {
System.Runtime.InteropServices.Marshal.FreeHGlobal(_ar[cx]);
}
GC.SuppressFinalize(this);
System.GC.SuppressFinalize(this);
}
}
%}
@@ -292,7 +292,7 @@ static SWIG_CSharpByteArrayHelperCallback SWIG_csharp_bytearray_callback = NULL;
private void CreateByteArray(System.IntPtr data, int size)
{
gdbuffer = new byte[size];
Marshal.Copy(data, gdbuffer, 0, size);
System.Runtime.InteropServices.Marshal.Copy(data, gdbuffer, 0, size);
}

public byte[] getBytes()
@@ -319,21 +319,21 @@ static SWIG_CSharpByteArrayHelperCallback SWIG_csharp_bytearray_callback = NULL;
public string processTemplate(int bGenerateImages, string[] names, string[] values)
{
if (names.Length != values.Length)
throw new ArgumentException("Invalid array length specified!");
throw new System.ArgumentException("Invalid array length specified!");
return processTemplate(bGenerateImages, names, values, values.Length);
}

public string processLegendTemplate(string[] names, string[] values)
{
if (names.Length != values.Length)
throw new ArgumentException("Invalid array length specified!");
throw new System.ArgumentException("Invalid array length specified!");
return processLegendTemplate(names, values, values.Length);
}

public string processQueryTemplate(string[] names, string[] values)
{
if (names.Length != values.Length)
throw new ArgumentException("Invalid array length specified!");
throw new System.ArgumentException("Invalid array length specified!");
return processQueryTemplate(names, values, values.Length);
}

@@ -384,7 +384,7 @@ static SWIG_CSharpByteArrayHelperCallback SWIG_csharp_bytearray_callback = NULL;
static void CreateByteArray(System.IntPtr data, int size)
{
arraybuffer = new byte[size];
Marshal.Copy(data, arraybuffer, 0, size);
System.Runtime.InteropServices.Marshal.Copy(data, arraybuffer, 0, size);
}

static SWIGByteArrayHelper()
@@ -41,28 +41,28 @@
if (managedObj == null)
return System.IntPtr.Zero;
if (!(managedObj is string))
throw new MarshalDirectiveException(
throw new System.Runtime.InteropServices.MarshalDirectiveException(
"UTF8Marshaler must be used on a string.");

// not null terminated
byte[] strbuf = System.Text.Encoding.UTF8.GetBytes((string)managedObj);
System.IntPtr buffer = Marshal.AllocHGlobal(strbuf.Length + 1);
Marshal.Copy(strbuf, 0, buffer, strbuf.Length);
System.IntPtr buffer = System.Runtime.InteropServices.Marshal.AllocHGlobal(strbuf.Length + 1);
System.Runtime.InteropServices.Marshal.Copy(strbuf, 0, buffer, strbuf.Length);

// write the terminating null
Marshal.WriteByte(buffer, strbuf.Length, 0);
System.Runtime.InteropServices.Marshal.WriteByte(buffer, strbuf.Length, 0);
return buffer;
}

public object MarshalNativeToManaged(System.IntPtr pNativeData) {
int len = Marshal.PtrToStringAnsi(pNativeData).Length;
int len = System.Runtime.InteropServices.Marshal.PtrToStringAnsi(pNativeData).Length;
byte[] utf8data = new byte[len];
Marshal.Copy(pNativeData, utf8data, 0, len);
System.Runtime.InteropServices.Marshal.Copy(pNativeData, utf8data, 0, len);
return System.Text.Encoding.UTF8.GetString(utf8data);
}

public void CleanUpNativeData(System.IntPtr pNativeData) {
Marshal.FreeHGlobal(pNativeData);
System.Runtime.InteropServices.Marshal.FreeHGlobal(pNativeData);
}

public void CleanUpManagedData(object managedObj) {
@@ -245,7 +245,7 @@
}
swigCPtr = new System.Runtime.InteropServices.HandleRef(null, System.IntPtr.Zero);
swigParentRef = null;
GC.SuppressFinalize(this);
System.GC.SuppressFinalize(this);
}
}

@@ -257,7 +257,7 @@
}
swigCPtr = new System.Runtime.InteropServices.HandleRef(null, System.IntPtr.Zero);
swigParentRef = null;
GC.SuppressFinalize(this);
System.GC.SuppressFinalize(this);
base.Dispose();
}
}

0 comments on commit 85019ea

Please sign in to comment.
You can’t perform that action at this time.