From: Jarl Gullberg Date: Sun, 30 Jul 2017 16:52:44 +0000 (+0200) Subject: Documented FunctionBody class. X-Git-Tag: v3.0.0~41^2~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8bd4de42a7948ca50d2cda97b746579493734d62;p=platform%2Fcore%2Fcsapi%2Fopentk.git Documented FunctionBody class. --- diff --git a/src/Generator.Bind/Structures/Function.cs b/src/Generator.Bind/Structures/Function.cs index 81ecdfd..939c4d9 100644 --- a/src/Generator.Bind/Structures/Function.cs +++ b/src/Generator.Bind/Structures/Function.cs @@ -92,12 +92,23 @@ namespace Bind.Structures } } + /// + /// The class acts as a wrapper around a block of source code that makes up the body + /// of a function. + /// public class FunctionBody : List { + /// + /// Initializes an empty . + /// public FunctionBody() { } + /// + /// Initializes a from an existing FunctionBody. + /// + /// The body to copy from. public FunctionBody(FunctionBody fb) { foreach (string s in fb) @@ -108,11 +119,17 @@ namespace Bind.Structures private string indent = ""; + /// + /// Indents this another level. + /// public void Indent() { indent += " "; } + /// + /// Removes a level of indentation from this . + /// public void Unindent() { if (indent.Length > 4) @@ -125,11 +142,19 @@ namespace Bind.Structures } } + /// + /// Adds a line of source code to the body at the current indentation level. + /// + /// The line to add. new public void Add(string s) { base.Add(indent + s.TrimEnd('\r', '\n')); } + /// + /// Adds a range of source code lines to the body at the current indentation level. + /// + /// new public void AddRange(IEnumerable collection) { foreach (string t in collection) @@ -138,6 +163,10 @@ namespace Bind.Structures } } + /// + /// Builds the contents of the function body into a string and encloses it with braces. + /// + /// The body, enclosed in braces. public override string ToString() { if (Count == 0)