Globablly qualify the use of types from the .NET framework's System namespace in the C# module and library.

This commit is contained in:
Brant K. Kyser 2013-10-17 13:27:48 -05:00
commit 3235570619
7 changed files with 60 additions and 60 deletions

View file

@ -848,7 +848,7 @@ SWIGINTERN const char * SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
%typemap(csbase) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [], SWIGTYPE (CLASS::*) ""
%typemap(csclassmodifiers) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [], SWIGTYPE (CLASS::*) "public class"
%typemap(cscode) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [], SWIGTYPE (CLASS::*) ""
%typemap(csimports) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [], SWIGTYPE (CLASS::*) "\nusing System;\nusing System.Runtime.InteropServices;\n"
%typemap(csimports) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [], SWIGTYPE (CLASS::*) "\nusing global::System;\nusing global::System.Runtime.InteropServices;\n"
%typemap(csinterfaces) SWIGTYPE "IDisposable"
%typemap(csinterfaces) SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [], SWIGTYPE (CLASS::*) ""
%typemap(csinterfaces_derived) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [], SWIGTYPE (CLASS::*) ""
@ -982,13 +982,13 @@ SWIG_CSBODY_TYPEWRAPPER(internal, protected, internal, SWIGTYPE)
%pragma(csharp) moduleclassmodifiers="public class"
%pragma(csharp) moduleimports=%{
using System;
using System.Runtime.InteropServices;
using global::System;
using global::System.Runtime.InteropServices;
%}
%pragma(csharp) imclassimports=%{
using System;
using System.Runtime.InteropServices;
using global::System;
using global::System.Runtime.InteropServices;
%}
/* Some ANSI C typemaps */
@ -1018,10 +1018,10 @@ using System.Runtime.InteropServices;
public class SWIGStringMarshal : IDisposable {
public readonly HandleRef swigCPtr;
public SWIGStringMarshal(string str) {
swigCPtr = new HandleRef(this, System.Runtime.InteropServices.Marshal.StringToHGlobalAnsi(str));
swigCPtr = new HandleRef(this, global::System.Runtime.InteropServices.Marshal.StringToHGlobalAnsi(str));
}
public virtual void Dispose() {
System.Runtime.InteropServices.Marshal.FreeHGlobal(swigCPtr.Handle);
global::System.Runtime.InteropServices.Marshal.FreeHGlobal(swigCPtr.Handle);
GC.SuppressFinalize(this);
}
}
@ -1031,7 +1031,7 @@ using System.Runtime.InteropServices;
%typemap(out) char *, char[ANY], char[] %{ $result = $1; %}
%typemap(csin) char *, char[ANY], char[] "new $imclassname.SWIGStringMarshal($csinput).swigCPtr"
%typemap(csout, excode=SWIGEXCODE) char *, char[ANY], char[] {
string ret = System.Runtime.InteropServices.Marshal.PtrToStringAnsi($imcall);$excode
string ret = global::System.Runtime.InteropServices.Marshal.PtrToStringAnsi($imcall);$excode
return ret;
}
%typemap(csvarin, excode=SWIGEXCODE2) char *, char[ANY], char[] %{
@ -1040,7 +1040,7 @@ using System.Runtime.InteropServices;
} %}
%typemap(csvarout, excode=SWIGEXCODE2) char *, char[ANY], char[] %{
get {
string ret = System.Runtime.InteropServices.Marshal.PtrToStringAnsi($imcall);$excode
string ret = global::System.Runtime.InteropServices.Marshal.PtrToStringAnsi($imcall);$excode
return ret;
} %}
*/

View file

@ -170,51 +170,51 @@ SWIGEXPORT void SWIGSTDCALL SWIGRegisterExceptionArgumentCallbacks_$module(
ExceptionArgumentDelegate argumentOutOfRangeDelegate);
static void SetPendingApplicationException(string message) {
SWIGPendingException.Set(new System.ApplicationException(message, SWIGPendingException.Retrieve()));
SWIGPendingException.Set(new global::System.ApplicationException(message, SWIGPendingException.Retrieve()));
}
static void SetPendingArithmeticException(string message) {
SWIGPendingException.Set(new System.ArithmeticException(message, SWIGPendingException.Retrieve()));
SWIGPendingException.Set(new global::System.ArithmeticException(message, SWIGPendingException.Retrieve()));
}
static void SetPendingDivideByZeroException(string message) {
SWIGPendingException.Set(new System.DivideByZeroException(message, SWIGPendingException.Retrieve()));
SWIGPendingException.Set(new global::System.DivideByZeroException(message, SWIGPendingException.Retrieve()));
}
static void SetPendingIndexOutOfRangeException(string message) {
SWIGPendingException.Set(new System.IndexOutOfRangeException(message, SWIGPendingException.Retrieve()));
SWIGPendingException.Set(new global::System.IndexOutOfRangeException(message, SWIGPendingException.Retrieve()));
}
static void SetPendingInvalidCastException(string message) {
SWIGPendingException.Set(new System.InvalidCastException(message, SWIGPendingException.Retrieve()));
SWIGPendingException.Set(new global::System.InvalidCastException(message, SWIGPendingException.Retrieve()));
}
static void SetPendingInvalidOperationException(string message) {
SWIGPendingException.Set(new System.InvalidOperationException(message, SWIGPendingException.Retrieve()));
SWIGPendingException.Set(new global::System.InvalidOperationException(message, SWIGPendingException.Retrieve()));
}
static void SetPendingIOException(string message) {
SWIGPendingException.Set(new System.IO.IOException(message, SWIGPendingException.Retrieve()));
SWIGPendingException.Set(new global::System.IO.IOException(message, SWIGPendingException.Retrieve()));
}
static void SetPendingNullReferenceException(string message) {
SWIGPendingException.Set(new System.NullReferenceException(message, SWIGPendingException.Retrieve()));
SWIGPendingException.Set(new global::System.NullReferenceException(message, SWIGPendingException.Retrieve()));
}
static void SetPendingOutOfMemoryException(string message) {
SWIGPendingException.Set(new System.OutOfMemoryException(message, SWIGPendingException.Retrieve()));
SWIGPendingException.Set(new global::System.OutOfMemoryException(message, SWIGPendingException.Retrieve()));
}
static void SetPendingOverflowException(string message) {
SWIGPendingException.Set(new System.OverflowException(message, SWIGPendingException.Retrieve()));
SWIGPendingException.Set(new global::System.OverflowException(message, SWIGPendingException.Retrieve()));
}
static void SetPendingSystemException(string message) {
SWIGPendingException.Set(new System.SystemException(message, SWIGPendingException.Retrieve()));
SWIGPendingException.Set(new global::System.SystemException(message, SWIGPendingException.Retrieve()));
}
static void SetPendingArgumentException(string message, string paramName) {
SWIGPendingException.Set(new System.ArgumentException(message, paramName, SWIGPendingException.Retrieve()));
SWIGPendingException.Set(new global::System.ArgumentException(message, paramName, SWIGPendingException.Retrieve()));
}
static void SetPendingArgumentNullException(string message, string paramName) {
Exception e = SWIGPendingException.Retrieve();
if (e != null) message = message + " Inner Exception: " + e.Message;
SWIGPendingException.Set(new System.ArgumentNullException(paramName, message));
SWIGPendingException.Set(new global::System.ArgumentNullException(paramName, message));
}
static void SetPendingArgumentOutOfRangeException(string message, string paramName) {
Exception e = SWIGPendingException.Retrieve();
if (e != null) message = message + " Inner Exception: " + e.Message;
SWIGPendingException.Set(new System.ArgumentOutOfRangeException(paramName, message));
SWIGPendingException.Set(new global::System.ArgumentOutOfRangeException(paramName, message));
}
static SWIGExceptionHelper() {

View file

@ -97,7 +97,7 @@
for (int i = 0; i < swigValues.Length; i++)
if (swigValues[i].swigValue == swigValue)
return swigValues[i];
throw new System.ArgumentOutOfRangeException("No enum $csclassname with value " + swigValue);
throw new global::System.ArgumentOutOfRangeException("No enum $csclassname with value " + swigValue);
}
public override string ToString() {

View file

@ -28,7 +28,7 @@
/* K is the C++ key type, T is the C++ value type */
%define SWIG_STD_MAP_INTERNAL(K, T, C)
%typemap(csinterfaces) std::map< K, T, C > "IDisposable \n#if !SWIG_DOTNET_1\n , System.Collections.Generic.IDictionary<$typemap(cstype, K), $typemap(cstype, T)>\n#endif\n";
%typemap(csinterfaces) std::map< K, T, C > "IDisposable \n#if !SWIG_DOTNET_1\n , global::System.Collections.Generic.IDictionary<$typemap(cstype, K), $typemap(cstype, T)>\n#endif\n";
%typemap(cscode) std::map<K, T, C > %{
public $typemap(cstype, T) this[$typemap(cstype, K) key] {
@ -64,9 +64,9 @@
#if !SWIG_DOTNET_1
public System.Collections.Generic.ICollection<$typemap(cstype, K)> Keys {
public global::System.Collections.Generic.ICollection<$typemap(cstype, K)> Keys {
get {
System.Collections.Generic.ICollection<$typemap(cstype, K)> keys = new System.Collections.Generic.List<$typemap(cstype, K)>();
global::System.Collections.Generic.ICollection<$typemap(cstype, K)> keys = new global::System.Collections.Generic.List<$typemap(cstype, K)>();
int size = this.Count;
if (size > 0) {
IntPtr iter = create_iterator_begin();
@ -79,21 +79,21 @@
}
}
public System.Collections.Generic.ICollection<$typemap(cstype, T)> Values {
public global::System.Collections.Generic.ICollection<$typemap(cstype, T)> Values {
get {
System.Collections.Generic.ICollection<$typemap(cstype, T)> vals = new System.Collections.Generic.List<$typemap(cstype, T)>();
foreach (System.Collections.Generic.KeyValuePair<$typemap(cstype, K), $typemap(cstype, T)> pair in this) {
global::System.Collections.Generic.ICollection<$typemap(cstype, T)> vals = new global::System.Collections.Generic.List<$typemap(cstype, T)>();
foreach (global::System.Collections.Generic.KeyValuePair<$typemap(cstype, K), $typemap(cstype, T)> pair in this) {
vals.Add(pair.Value);
}
return vals;
}
}
public void Add(System.Collections.Generic.KeyValuePair<$typemap(cstype, K), $typemap(cstype, T)> item) {
public void Add(global::System.Collections.Generic.KeyValuePair<$typemap(cstype, K), $typemap(cstype, T)> item) {
Add(item.Key, item.Value);
}
public bool Remove(System.Collections.Generic.KeyValuePair<$typemap(cstype, K), $typemap(cstype, T)> item) {
public bool Remove(global::System.Collections.Generic.KeyValuePair<$typemap(cstype, K), $typemap(cstype, T)> item) {
if (Contains(item)) {
return Remove(item.Key);
} else {
@ -101,7 +101,7 @@
}
}
public bool Contains(System.Collections.Generic.KeyValuePair<$typemap(cstype, K), $typemap(cstype, T)> item) {
public bool Contains(global::System.Collections.Generic.KeyValuePair<$typemap(cstype, K), $typemap(cstype, T)> item) {
if (this[item.Key] == item.Value) {
return true;
} else {
@ -109,11 +109,11 @@
}
}
public void CopyTo(System.Collections.Generic.KeyValuePair<$typemap(cstype, K), $typemap(cstype, T)>[] array) {
public void CopyTo(global::System.Collections.Generic.KeyValuePair<$typemap(cstype, K), $typemap(cstype, T)>[] array) {
CopyTo(array, 0);
}
public void CopyTo(System.Collections.Generic.KeyValuePair<$typemap(cstype, K), $typemap(cstype, T)>[] array, int arrayIndex) {
public void CopyTo(global::System.Collections.Generic.KeyValuePair<$typemap(cstype, K), $typemap(cstype, T)>[] array, int arrayIndex) {
if (array == null)
throw new ArgumentNullException("array");
if (arrayIndex < 0)
@ -123,18 +123,18 @@
if (arrayIndex+this.Count > array.Length)
throw new ArgumentException("Number of elements to copy is too large.");
System.Collections.Generic.IList<$typemap(cstype, K)> keyList = new System.Collections.Generic.List<$typemap(cstype, K)>(this.Keys);
global::System.Collections.Generic.IList<$typemap(cstype, K)> keyList = new global::System.Collections.Generic.List<$typemap(cstype, K)>(this.Keys);
for (int i = 0; i < keyList.Count; i++) {
$typemap(cstype, K) currentKey = keyList[i];
array.SetValue(new System.Collections.Generic.KeyValuePair<$typemap(cstype, K), $typemap(cstype, T)>(currentKey, this[currentKey]), arrayIndex+i);
array.SetValue(new global::System.Collections.Generic.KeyValuePair<$typemap(cstype, K), $typemap(cstype, T)>(currentKey, this[currentKey]), arrayIndex+i);
}
}
System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<$typemap(cstype, K), $typemap(cstype, T)>> System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<$typemap(cstype, K), $typemap(cstype, T)>>.GetEnumerator() {
global::System.Collections.Generic.IEnumerator<global::System.Collections.Generic.KeyValuePair<$typemap(cstype, K), $typemap(cstype, T)>> global::System.Collections.Generic.IEnumerable<global::System.Collections.Generic.KeyValuePair<$typemap(cstype, K), $typemap(cstype, T)>>.GetEnumerator() {
return new $csclassnameEnumerator(this);
}
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() {
global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator() {
return new $csclassnameEnumerator(this);
}
@ -147,25 +147,25 @@
/// whenever the collection is modified. This has been done for changes in the size of the
/// collection but not when one of the elements of the collection is modified as it is a bit
/// tricky to detect unmanaged code that modifies the collection under our feet.
public sealed class $csclassnameEnumerator : System.Collections.IEnumerator,
System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<$typemap(cstype, K), $typemap(cstype, T)>>
public sealed class $csclassnameEnumerator : global::System.Collections.IEnumerator,
global::System.Collections.Generic.IEnumerator<global::System.Collections.Generic.KeyValuePair<$typemap(cstype, K), $typemap(cstype, T)>>
{
private $csclassname collectionRef;
private System.Collections.Generic.IList<$typemap(cstype, K)> keyCollection;
private global::System.Collections.Generic.IList<$typemap(cstype, K)> keyCollection;
private int currentIndex;
private object currentObject;
private int currentSize;
public $csclassnameEnumerator($csclassname collection) {
collectionRef = collection;
keyCollection = new System.Collections.Generic.List<$typemap(cstype, K)>(collection.Keys);
keyCollection = new global::System.Collections.Generic.List<$typemap(cstype, K)>(collection.Keys);
currentIndex = -1;
currentObject = null;
currentSize = collectionRef.Count;
}
// Type-safe iterator Current
public System.Collections.Generic.KeyValuePair<$typemap(cstype, K), $typemap(cstype, T)> Current {
public global::System.Collections.Generic.KeyValuePair<$typemap(cstype, K), $typemap(cstype, T)> Current {
get {
if (currentIndex == -1)
throw new InvalidOperationException("Enumeration not started.");
@ -173,12 +173,12 @@
throw new InvalidOperationException("Enumeration finished.");
if (currentObject == null)
throw new InvalidOperationException("Collection modified.");
return (System.Collections.Generic.KeyValuePair<$typemap(cstype, K), $typemap(cstype, T)>)currentObject;
return (global::System.Collections.Generic.KeyValuePair<$typemap(cstype, K), $typemap(cstype, T)>)currentObject;
}
}
// Type-unsafe IEnumerator.Current
object System.Collections.IEnumerator.Current {
object global::System.Collections.IEnumerator.Current {
get {
return Current;
}
@ -190,7 +190,7 @@
if (moveOkay) {
currentIndex++;
$typemap(cstype, K) currentKey = keyCollection[currentIndex];
currentObject = new System.Collections.Generic.KeyValuePair<$typemap(cstype, K), $typemap(cstype, T)>(currentKey, collectionRef[currentKey]);
currentObject = new global::System.Collections.Generic.KeyValuePair<$typemap(cstype, K), $typemap(cstype, T)>(currentKey, collectionRef[currentKey]);
} else {
currentObject = null;
}

View file

@ -26,9 +26,9 @@
// MACRO for use within the std::vector class body
%define SWIG_STD_VECTOR_MINIMUM_INTERNAL(CSINTERFACE, CONST_REFERENCE, CTYPE...)
%typemap(csinterfaces) std::vector< CTYPE > "IDisposable, System.Collections.IEnumerable\n#if !SWIG_DOTNET_1\n , System.Collections.Generic.CSINTERFACE<$typemap(cstype, CTYPE)>\n#endif\n";
%typemap(csinterfaces) std::vector< CTYPE > "IDisposable, global::System.Collections.IEnumerable\n#if !SWIG_DOTNET_1\n , global::System.Collections.Generic.CSINTERFACE<$typemap(cstype, CTYPE)>\n#endif\n";
%typemap(cscode) std::vector< CTYPE > %{
public $csclassname(System.Collections.ICollection c) : this() {
public $csclassname(global::System.Collections.ICollection c) : this() {
if (c == null)
throw new ArgumentNullException("c");
foreach ($typemap(cstype, CTYPE) element in c) {
@ -81,7 +81,7 @@
}
#if SWIG_DOTNET_1
public void CopyTo(System.Array array)
public void CopyTo(global::System.Array array)
#else
public void CopyTo($typemap(cstype, CTYPE)[] array)
#endif
@ -90,7 +90,7 @@
}
#if SWIG_DOTNET_1
public void CopyTo(System.Array array, int arrayIndex)
public void CopyTo(global::System.Array array, int arrayIndex)
#else
public void CopyTo($typemap(cstype, CTYPE)[] array, int arrayIndex)
#endif
@ -99,7 +99,7 @@
}
#if SWIG_DOTNET_1
public void CopyTo(int index, System.Array array, int arrayIndex, int count)
public void CopyTo(int index, global::System.Array array, int arrayIndex, int count)
#else
public void CopyTo(int index, $typemap(cstype, CTYPE)[] array, int arrayIndex, int count)
#endif
@ -121,12 +121,12 @@
}
#if !SWIG_DOTNET_1
System.Collections.Generic.IEnumerator<$typemap(cstype, CTYPE)> System.Collections.Generic.IEnumerable<$typemap(cstype, CTYPE)>.GetEnumerator() {
global::System.Collections.Generic.IEnumerator<$typemap(cstype, CTYPE)> global::System.Collections.Generic.IEnumerable<$typemap(cstype, CTYPE)>.GetEnumerator() {
return new $csclassnameEnumerator(this);
}
#endif
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() {
global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator() {
return new $csclassnameEnumerator(this);
}
@ -139,9 +139,9 @@
/// whenever the collection is modified. This has been done for changes in the size of the
/// collection but not when one of the elements of the collection is modified as it is a bit
/// tricky to detect unmanaged code that modifies the collection under our feet.
public sealed class $csclassnameEnumerator : System.Collections.IEnumerator
public sealed class $csclassnameEnumerator : global::System.Collections.IEnumerator
#if !SWIG_DOTNET_1
, System.Collections.Generic.IEnumerator<$typemap(cstype, CTYPE)>
, global::System.Collections.Generic.IEnumerator<$typemap(cstype, CTYPE)>
#endif
{
private $csclassname collectionRef;
@ -170,7 +170,7 @@
}
// Type-unsafe IEnumerator.Current
object System.Collections.IEnumerator.Current {
object global::System.Collections.IEnumerator.Current {
get {
return Current;
}

View file

@ -27,7 +27,7 @@ static SWIG_CSharpWStringHelperCallback SWIG_csharp_wstring_callback = NULL;
public static extern void SWIGRegisterWStringCallback_$module(SWIGWStringDelegate wstringDelegate);
static string CreateWString([MarshalAs(UnmanagedType.LPWStr)]IntPtr cString) {
return System.Runtime.InteropServices.Marshal.PtrToStringUni(cString);
return global::System.Runtime.InteropServices.Marshal.PtrToStringUni(cString);
}
static SWIGWStringHelper() {
@ -82,7 +82,7 @@ SWIGEXPORT void SWIGSTDCALL SWIGRegisterWStringCallback_$module(SWIG_CSharpWStri
%typemap(csin) wchar_t * "$csinput"
%typemap(csout, excode=SWIGEXCODE) wchar_t * {
string ret = System.Runtime.InteropServices.Marshal.PtrToStringUni($imcall);$excode
string ret = global::System.Runtime.InteropServices.Marshal.PtrToStringUni($imcall);$excode
return ret;
}
%typemap(csvarin, excode=SWIGEXCODE2) wchar_t * %{