From: Jürg Billeter Date: Sat, 27 Sep 2008 09:12:16 +0000 (+0000) Subject: Add accessors for nested types, patch by Florian Brosch, fixes bug 552958 X-Git-Tag: VALA_0_4_0~64 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0af5811bec305443e3df2e7eebb8e419c68359ff;p=thirdparty%2Fvala.git Add accessors for nested types, patch by Florian Brosch, fixes bug 552958 2008-09-27 Jürg Billeter * vala/valaclass.vala: * vala/valainterface.vala: * vala/valastruct.vala: Add accessors for nested types, patch by Florian Brosch, fixes bug 552958 svn path=/trunk/; revision=1797 --- diff --git a/ChangeLog b/ChangeLog index a5b52ad5a..ff524bd1d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-09-27 Jürg Billeter + + * vala/valaclass.vala: + * vala/valainterface.vala: + * vala/valastruct.vala: + + Add accessors for nested types, patch by Florian Brosch, + fixes bug 552958 + 2008-09-27 Jürg Billeter * vapi/glib-2.0.vapi: diff --git a/vala/valaclass.vala b/vala/valaclass.vala index cdff1ed61..82681f340 100644 --- a/vala/valaclass.vala +++ b/vala/valaclass.vala @@ -120,6 +120,42 @@ public class Vala.Class : ObjectTypeSymbol { private Gee.List enums = new ArrayList (); private Gee.List delegates = new ArrayList (); + /** + * Returns a copy of the list of classes. + * + * @return list of classes + */ + public Gee.List get_classes () { + return new ReadOnlyList (classes); + } + + /** + * Returns a copy of the list of structs. + * + * @return list of structs + */ + public Gee.List get_structs () { + return new ReadOnlyList (structs); + } + + /** + * Returns a copy of the list of enums. + * + * @return list of enums + */ + public Gee.List get_enums () { + return new ReadOnlyList (enums); + } + + /** + * Returns a copy of the list of delegates. + * + * @return list of delegates + */ + public Gee.List get_delegates () { + return new ReadOnlyList (delegates); + } + /** * Specifies the default construction method. */ @@ -248,7 +284,16 @@ public class Vala.Class : ObjectTypeSymbol { public Gee.List get_fields () { return new ReadOnlyList (fields); } - + + /** + * Returns a copy of the list of constants. + * + * @return list of constants + */ + public Gee.List get_constants () { + return new ReadOnlyList (constants); + } + /** * Adds the specified method as a member to this class. * diff --git a/vala/valainterface.vala b/vala/valainterface.vala index 954903fa9..83bc577cf 100644 --- a/vala/valainterface.vala +++ b/vala/valainterface.vala @@ -52,7 +52,43 @@ public class Vala.Interface : ObjectTypeSymbol { private string lower_case_csuffix; private string type_cname; private string type_id; - + + /** + * Returns a copy of the list of classes. + * + * @return list of classes + */ + public Gee.List get_classes () { + return new ReadOnlyList (classes); + } + + /** + * Returns a copy of the list of structs. + * + * @return list of structs + */ + public Gee.List get_structs () { + return new ReadOnlyList (structs); + } + + /** + * Returns a copy of the list of enums. + * + * @return list of enums + */ + public Gee.List get_enums () { + return new ReadOnlyList (enums); + } + + /** + * Returns a copy of the list of delegates. + * + * @return list of delegates + */ + public Gee.List get_delegates () { + return new ReadOnlyList (delegates); + } + /** * Creates a new interface. * diff --git a/vala/valastruct.vala b/vala/valastruct.vala index 6e49ee511..0876429d6 100644 --- a/vala/valastruct.vala +++ b/vala/valastruct.vala @@ -117,7 +117,16 @@ public class Vala.Struct : TypeSymbol { public Gee.List get_fields () { return new ReadOnlyList (fields); } - + + /** + * Returns a copy of the list of constants. + * + * @return list of constants + */ + public Gee.List get_constants () { + return new ReadOnlyList (constants); + } + /** * Adds the specified method as a member to this struct. *