2005-07-02 Mike Kestner <mkestner@novell.com>

* generator/StructField.cs : fix name exception throw conditional.

svn path=/trunk/gtk-sharp/; revision=46890
This commit is contained in:
Mike Kestner 2005-07-03 15:14:09 +00:00
parent 144a0f9d20
commit 0863f8703f
2 changed files with 8 additions and 14 deletions

View file

@ -1,3 +1,7 @@
2005-07-02 Mike Kestner <mkestner@novell.com>
* generator/StructField.cs : fix name exception throw conditional.
2005-07-02 Mike Kestner <mkestner@novell.com> 2005-07-02 Mike Kestner <mkestner@novell.com>
* generator/CallbackGen.cs : implement new IAccessor iface so that * generator/CallbackGen.cs : implement new IAccessor iface so that

View file

@ -41,7 +41,7 @@ namespace GtkSharp.Generation {
} }
} }
public int ArrayLength { int ArrayLength {
get { get {
if (!IsArray) if (!IsArray)
return 0; return 0;
@ -96,19 +96,9 @@ namespace GtkSharp.Generation {
string StudlyName { string StudlyName {
get { get {
string studly = base.Name; string studly = base.Name;
if (studly != "") if (studly == "")
return studly; throw new Exception ("API file must be regenerated with a current version of the GAPI parser. It is incompatible with this version of the GAPI code generator.");
// FIXME: this is backward compatibility for API files
// output by older versions of the parser. It can go
// away at some point.
string name = CName;
string[] segs = name.Split('_');
foreach (string s in segs) {
if (s.Trim () == "")
continue;
studly += (s.Substring(0,1).ToUpper() + s.Substring(1));
}
return studly; return studly;
} }
} }
@ -130,7 +120,7 @@ namespace GtkSharp.Generation {
sw.WriteLine (indent + "{0} {1} {2};", Access, CSType, StudlyName); sw.WriteLine (indent + "{0} {1} {2};", Access, CSType, StudlyName);
} else if (IsBitfield) { } else if (IsBitfield) {
base.Generate (gen_info, indent); base.Generate (gen_info, indent);
} else if (table [CType] is IAccessor) { } else if (gen is IAccessor) {
sw.WriteLine (indent + "private {0} {1};", gen.MarshalType, Name); sw.WriteLine (indent + "private {0} {1};", gen.MarshalType, Name);
if (Access != "private") { if (Access != "private") {