Fixed generic parameter definitions.

This commit is contained in:
the_fiddler 2011-12-05 12:27:23 +00:00
parent 72123730e4
commit 1a8177dc8f

View file

@ -93,32 +93,13 @@ namespace Bind
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
#region WriteDefinitions
void WriteDefinitions(BindStreamWriter sw,
EnumCollection enums, FunctionCollection wrappers,
Dictionary<string, string> CSTypes)
EnumCollection enums, FunctionCollection wrappers,
Dictionary<string, string> CSTypes)
{
sw.WriteLine("public class {0}", Settings.GLClass);
sw.WriteLine("{");
@ -152,15 +133,6 @@ namespace Bind
#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
public void WriteEnums(BindStreamWriter sw, EnumCollection enums)
@ -187,6 +159,25 @@ namespace Bind
#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)
{
//var callstring = f.Parameters.CallString();