document struct declarations
authorJuerg Billeter <j@bitron.ch>
Mon, 10 Sep 2007 12:37:36 +0000 (12:37 +0000)
committerJürg Billeter <juergbi@src.gnome.org>
Mon, 10 Sep 2007 12:37:36 +0000 (12:37 +0000)
2007-09-10  Juerg Billeter  <j@bitron.ch>

* doc/vala/structs.xml: document struct declarations

svn path=/trunk/; revision=600

ChangeLog
doc/vala/structs.xml

index 75f82c1..653b4b9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2007-09-10  Jürg Billeter  <j@bitron.ch>
+
+       * doc/vala/structs.xml: document struct declarations
+
 2007-09-09  Jürg Billeter  <j@bitron.ch>
 
        * vala/valasymbolresolver.vala: detect interface prerequisite cycle
index 478f302..c3ef1cd 100644 (file)
@@ -1,5 +1,24 @@
 <?xml version="1.0"?>
 <section id="structs">
        <h>Structs</h>
+       <p>A struct is a data type that can contain fields, constants, and methods.</p>
+       <section id="declaration">
+               <h>Struct declarations</h>
+               <p>The simplest struct declaration looks like this:</p>
+               <blockcode>
+struct StructName {
+       &lt;struct-member&gt;
+}</blockcode>
+               <p>You may optionally specify an accessibility modifier. Structs support <code>public</code> and <code>private</code> accessibility and default to private if you don't specify one. Public structs may be accessed from outside the library or application they are defined in.</p>
+               <blockcode>
+public struct StructName {
+       &lt;struct-member&gt;
+}</blockcode>
+               <p>You may optionally prefix the struct name with a namespace name. This places the struct in the specified namespace without the need for a separate namespace declaration.</p>
+               <blockcode>
+struct NamespaceName.StructName {
+       &lt;struct-member&gt;
+}</blockcode>
+       </section>
 </section>