Moved output filenames to Settings class.

This commit is contained in:
the_fiddler 2010-12-02 21:58:49 +00:00
parent 33bdb90b70
commit c3bfa7dc9a
6 changed files with 24 additions and 32 deletions

View file

@ -16,7 +16,7 @@ namespace Bind.CL
{
glTypemap = null;
wrappersFile = "CL.cs";
Settings.WrappersFile = "CL.cs";
Settings.FunctionPrefix = "cl";
Settings.ConstantPrefix = "CL_";

View file

@ -41,20 +41,8 @@ namespace Bind
sealed class CSharpSpecWriter : ISpecWriter
{
readonly string wrappersFile;
readonly string enumsFile;
readonly string delegatesFile;
readonly string importsFile;
readonly char[] numbers = "0123456789".ToCharArray();
public CSharpSpecWriter(string wrappersFile, string importsFile, string enumsFile, string delegatesFile)
{
this.wrappersFile = wrappersFile;
this.importsFile = importsFile;
this.enumsFile = enumsFile;
this.delegatesFile = delegatesFile;
}
#region WriteBindings
public void WriteBindings(DelegateCollection delegates, FunctionCollection wrappers, EnumCollection enums)
@ -156,10 +144,10 @@ namespace Bind
sw.WriteLine("}");
}
string output_enums = Path.Combine(Settings.OutputPath, enumsFile);
string output_delegates = Path.Combine(Settings.OutputPath, delegatesFile);
string output_core = Path.Combine(Settings.OutputPath, importsFile);
string output_wrappers = Path.Combine(Settings.OutputPath, wrappersFile);
string output_enums = Path.Combine(Settings.OutputPath, Settings.EnumsFile);
string output_delegates = Path.Combine(Settings.OutputPath, Settings.DelegatesFile);
string output_core = Path.Combine(Settings.OutputPath, Settings.ImportsFile);
string output_wrappers = Path.Combine(Settings.OutputPath, Settings.WrappersFile);
if (File.Exists(output_enums)) File.Delete(output_enums);
if (File.Exists(output_delegates)) File.Delete(output_delegates);

View file

@ -27,10 +27,10 @@ namespace Bind.ES
glSpecExt = String.Empty;
functionOverridesFile = dirName + "/overrides.xml";
importsFile = "Core.cs";
delegatesFile = "Delegates.cs";
enumsFile = "Enums.cs";
wrappersFile = "ES.cs";
Settings.ImportsFile = "Core.cs";
Settings.DelegatesFile = "Delegates.cs";
Settings.EnumsFile = "Enums.cs";
Settings.WrappersFile = "ES.cs";
Settings.ImportsClass = "Core";
Settings.DelegatesClass = "Delegates";

View file

@ -46,10 +46,10 @@ namespace Bind.GL2
glSpecExt = String.Empty;
functionOverridesFile = "GL2/gloverrides.xml";
importsFile = "GLCore.cs";
delegatesFile = "GLDelegates.cs";
enumsFile = "GLEnums.cs";
wrappersFile = "GL.cs";
Settings.ImportsFile = "GLCore.cs";
Settings.DelegatesFile = "GLDelegates.cs";
Settings.EnumsFile = "GLEnums.cs";
Settings.WrappersFile = "GL.cs";
Settings.ImportsClass = "Core";
Settings.DelegatesClass = "Delegates";

View file

@ -29,11 +29,6 @@ namespace Bind.GL2
protected static string glSpec = "GL2/gl.spec";
protected static string glSpecExt = "";
protected static string importsFile = "GLCore.cs";
protected static string delegatesFile = "GLDelegates.cs";
protected static string enumsFile = "GLEnums.cs";
protected static string wrappersFile = "GL.cs";
protected static string functionOverridesFile = "GL2/gloverrides.xml";
protected static string loadAllFuncName = "LoadAll";
@ -44,8 +39,7 @@ namespace Bind.GL2
//protected static readonly Dictionary<string, string> doc_replacements;
protected ISpecReader SpecReader = new XmlSpecReader(functionOverridesFile);
protected ISpecWriter SpecWriter = new CSharpSpecWriter(wrappersFile, importsFile,
enumsFile, delegatesFile);
protected ISpecWriter SpecWriter = new CSharpSpecWriter();
#endregion
@ -62,6 +56,11 @@ namespace Bind.GL2
{
// Defaults
}
Settings.ImportsFile = "GLCore.cs";
Settings.DelegatesFile = "GLDelegates.cs";
Settings.EnumsFile = "GLEnums.cs";
Settings.WrappersFile = "GL.cs";
}
#endregion

View file

@ -33,6 +33,11 @@ namespace Bind
public static string ConstantPrefix = "GL_";
public static string EnumPrefix = "";
public static string ImportsFile = "Core.cs";
public static string DelegatesFile = "Delegates.cs";
public static string EnumsFile = "Enums.cs";
public static string WrappersFile = "GL.cs";
// TODO: This code is too fragile.
// Old enums code:
public static string normalEnumsClassOverride = null;