From 0863f8703f0bd25c8306121fbbae6d8b86ef5b38 Mon Sep 17 00:00:00 2001 From: Mike Kestner Date: Sun, 3 Jul 2005 15:14:09 +0000 Subject: [PATCH] 2005-07-02 Mike Kestner * generator/StructField.cs : fix name exception throw conditional. svn path=/trunk/gtk-sharp/; revision=46890 --- ChangeLog | 4 ++++ generator/StructField.cs | 18 ++++-------------- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index 25c3da055..e20f334ca 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2005-07-02 Mike Kestner + + * generator/StructField.cs : fix name exception throw conditional. + 2005-07-02 Mike Kestner * generator/CallbackGen.cs : implement new IAccessor iface so that diff --git a/generator/StructField.cs b/generator/StructField.cs index 59a4f6b44..58f92d494 100644 --- a/generator/StructField.cs +++ b/generator/StructField.cs @@ -41,7 +41,7 @@ namespace GtkSharp.Generation { } } - public int ArrayLength { + int ArrayLength { get { if (!IsArray) return 0; @@ -96,19 +96,9 @@ namespace GtkSharp.Generation { string StudlyName { get { string studly = base.Name; - if (studly != "") - return studly; + if (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; } } @@ -130,7 +120,7 @@ namespace GtkSharp.Generation { sw.WriteLine (indent + "{0} {1} {2};", Access, CSType, StudlyName); } else if (IsBitfield) { 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); if (Access != "private") {