* Main.cs:

* Settings.cs:
* FuncProcessor.cs:
* Structures/Type.cs:
* Structures/Constant.cs:
* Structures/Delegate.cs: Do not hardcode namespace separator to ".".
This commit is contained in:
the_fiddler 2010-12-05 15:45:23 +00:00
parent 84dcb6395f
commit 95a906647e
6 changed files with 17 additions and 12 deletions

View file

@ -169,7 +169,8 @@ namespace Bind
if (d.ReturnType.CurrentType.Contains("GLenum"))
{
if ((Settings.Compatibility & Settings.Legacy.ConstIntEnums) == Settings.Legacy.None)
d.ReturnType.QualifiedType = String.Format("{0}.{1}", Settings.EnumsOutput, Settings.CompleteEnumName);
d.ReturnType.QualifiedType = String.Format("{0}{1}{2}",
Settings.EnumsOutput, Settings.NamespaceSeparator, Settings.CompleteEnumName);
else
d.ReturnType.QualifiedType = "int";
}

View file

@ -86,6 +86,7 @@ namespace Bind
Settings.DefaultOutputPath = "gl";
Settings.DefaultOutputNamespace = "OpenTK";
Settings.EnumsNamespace = "";
Settings.NamespaceSeparator = "::";
}
break;
}

View file

@ -35,6 +35,7 @@ namespace Bind
public static string FunctionPrefix = "gl";
public static string ConstantPrefix = "GL_";
public static string EnumPrefix = "";
public static string NamespaceSeparator = ".";
public static string ImportsFile = "Core.cs";
public static string DelegatesFile = "Delegates.cs";
@ -51,14 +52,14 @@ namespace Bind
{
return
normalEnumsClassOverride == null ?
String.IsNullOrEmpty(NestedEnumsClass) ? OutputClass : OutputClass + "." + NestedEnumsClass :
String.IsNullOrEmpty(NestedEnumsClass) ? OutputClass : OutputClass + NamespaceSeparator + NestedEnumsClass :
normalEnumsClassOverride;
}
}
public static string AuxEnumsClass
{
get { return GLClass + "." + NestedEnumsClass; }
get { return GLClass + NamespaceSeparator + NestedEnumsClass; }
}
public static string EnumsOutput
@ -66,9 +67,9 @@ namespace Bind
get
{
if ((Compatibility & Legacy.NestedEnums) != Legacy.None)
return OutputNamespace + "." + OutputClass + "." + NestedEnumsClass;
return OutputNamespace + NamespaceSeparator + OutputClass + NamespaceSeparator + NestedEnumsClass;
else
return String.IsNullOrEmpty(EnumsNamespace) ? OutputNamespace : OutputNamespace + "." + EnumsNamespace;
return String.IsNullOrEmpty(EnumsNamespace) ? OutputNamespace : OutputNamespace + NamespaceSeparator + EnumsNamespace;
}
}
@ -77,9 +78,9 @@ namespace Bind
get
{
if ((Compatibility & Legacy.NestedEnums) != Legacy.None)
return OutputNamespace + "." + GLClass + "." + NestedEnumsClass;
return OutputNamespace + NamespaceSeparator + GLClass + NamespaceSeparator + NestedEnumsClass;
else
return OutputNamespace + "." + EnumsNamespace;
return OutputNamespace + NamespaceSeparator + EnumsNamespace;
}
}

View file

@ -265,7 +265,7 @@ namespace Bind.Structures
return "";
return String.Format("{0} = {1}((int){2}{3})",
Name, Unchecked ? "unchecked" : "",
!String.IsNullOrEmpty(Reference) ? Reference + "." : "", Value);
!String.IsNullOrEmpty(Reference) ? Reference + Settings.NamespaceSeparator : "", Value);
//return String.Format("{0} = {1}((int){2})", Name, Unchecked ? "unchecked" : "", Value);
}

View file

@ -259,7 +259,7 @@ namespace Bind.Structures
StringBuilder sb = new StringBuilder();
sb.Append(Settings.DelegatesClass);
sb.Append(".");
sb.Append(Settings.NamespaceSeparator);
sb.Append(Settings.FunctionPrefix);
sb.Append(Name);
sb.Append(Parameters.CallString());

View file

@ -58,7 +58,7 @@ namespace Bind.Structures
get
{
if (!String.IsNullOrEmpty(CurrentQualifier))
return String.Format("{0}.{1}", CurrentQualifier, CurrentType);
return String.Format("{0}{1}{2}", CurrentQualifier, Settings.NamespaceSeparator, CurrentType);
else
return CurrentType;
}
@ -367,11 +367,13 @@ namespace Bind.Structures
// Better match: enum.Name == function.Category (e.g. GL_VERSION_1_1 etc)
if (enums.ContainsKey(category))
{
QualifiedType = String.Format("{0}.{1}", Settings.EnumsOutput, EnumProcessor.TranslateEnumName(category));
QualifiedType = String.Format("{0}{1}{2}", Settings.EnumsOutput,
Settings.NamespaceSeparator, EnumProcessor.TranslateEnumName(category));
}
else
{
QualifiedType = String.Format("{0}.{1}", Settings.EnumsOutput, Settings.CompleteEnumName);
QualifiedType = String.Format("{0}{1}{2}", Settings.EnumsOutput,
Settings.NamespaceSeparator, Settings.CompleteEnumName);
}
}
}