Fixed generic parameter definitions.
This commit is contained in:
parent
aa40b760df
commit
14c56427ed
1 changed files with 21 additions and 30 deletions
|
@ -93,32 +93,13 @@ namespace Bind
|
||||||
File.Move(file, dest);
|
File.Move(file, dest);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void WriteWrapper(Function f, BindStreamWriter sw)
|
|
||||||
{
|
|
||||||
var parameters = GenerateParameterString(f);
|
|
||||||
var generic_parameters = GenerateGenericParameterString(f);
|
|
||||||
|
|
||||||
if (!String.IsNullOrEmpty(generic_parameters))
|
|
||||||
sw.WriteLine("public static {0} {1}<{2}>({3})", f.ReturnType, f.TrimmedName,
|
|
||||||
generic_parameters, parameters);
|
|
||||||
else
|
|
||||||
sw.WriteLine("public static {0} {1}({2})", f.ReturnType, f.TrimmedName,
|
|
||||||
parameters);
|
|
||||||
|
|
||||||
sw.WriteLine("{");
|
|
||||||
sw.Indent();
|
|
||||||
WriteMethodBody(sw, f);
|
|
||||||
sw.Unindent();
|
|
||||||
sw.WriteLine("}");
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region WriteDefinitions
|
#region WriteDefinitions
|
||||||
|
|
||||||
void WriteDefinitions(BindStreamWriter sw,
|
void WriteDefinitions(BindStreamWriter sw,
|
||||||
EnumCollection enums, FunctionCollection wrappers,
|
EnumCollection enums, FunctionCollection wrappers,
|
||||||
Dictionary<string, string> CSTypes)
|
Dictionary<string, string> CSTypes)
|
||||||
{
|
{
|
||||||
sw.WriteLine("public class {0}", Settings.GLClass);
|
sw.WriteLine("public class {0}", Settings.GLClass);
|
||||||
sw.WriteLine("{");
|
sw.WriteLine("{");
|
||||||
|
@ -152,15 +133,6 @@ namespace Bind
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
static string GetNamespace(string ext)
|
|
||||||
{
|
|
||||||
if (ext == "Core")
|
|
||||||
return Settings.GLClass;
|
|
||||||
else
|
|
||||||
return String.Format("{1}{0}{2}", Settings.NamespaceSeparator,
|
|
||||||
Settings.GLClass, Char.IsDigit(ext[0]) ? DigitPrefix + ext : ext);
|
|
||||||
}
|
|
||||||
|
|
||||||
#region WriteEnums
|
#region WriteEnums
|
||||||
|
|
||||||
public void WriteEnums(BindStreamWriter sw, EnumCollection enums)
|
public void WriteEnums(BindStreamWriter sw, EnumCollection enums)
|
||||||
|
@ -187,6 +159,25 @@ namespace Bind
|
||||||
|
|
||||||
#region WriteWrappers
|
#region WriteWrappers
|
||||||
|
|
||||||
|
static void WriteWrapper(Function f, BindStreamWriter sw)
|
||||||
|
{
|
||||||
|
var parameters = GenerateParameterString(f);
|
||||||
|
var generic_parameters = GenerateGenericParameterString(f);
|
||||||
|
|
||||||
|
if (!String.IsNullOrEmpty(generic_parameters))
|
||||||
|
sw.WriteLine("public static {0} <1> {2}({3})", f.ReturnType, generic_parameters,
|
||||||
|
f.TrimmedName, parameters);
|
||||||
|
else
|
||||||
|
sw.WriteLine("public static {0} {1}({2})", f.ReturnType, f.TrimmedName,
|
||||||
|
parameters);
|
||||||
|
|
||||||
|
sw.WriteLine("{");
|
||||||
|
sw.Indent();
|
||||||
|
WriteMethodBody(sw, f);
|
||||||
|
sw.Unindent();
|
||||||
|
sw.WriteLine("}");
|
||||||
|
}
|
||||||
|
|
||||||
static void WriteMethodBody(BindStreamWriter sw, Function f)
|
static void WriteMethodBody(BindStreamWriter sw, Function f)
|
||||||
{
|
{
|
||||||
//var callstring = f.Parameters.CallString();
|
//var callstring = f.Parameters.CallString();
|
||||||
|
|
Loading…
Reference in a new issue