diff --git a/Source/Bind/CSharpSpecWriter.cs b/Source/Bind/CSharpSpecWriter.cs index cb9ab8f9..ebaeb4bf 100644 --- a/Source/Bind/CSharpSpecWriter.cs +++ b/Source/Bind/CSharpSpecWriter.cs @@ -327,6 +327,16 @@ namespace Bind docs[0] = docs[0].Insert(summary_start, category); } + foreach (var param in f.WrappedDelegate.Parameters) + { + var index = docs.IndexOf("/// "); + if (index != -1 && param.ComputeSize != "") + { + var compute_size = string.Format("[length: {0}]", param.ComputeSize); + docs[index] = docs[index] + compute_size; + } + } + foreach (var doc in docs) { sw.WriteLine(doc); diff --git a/Source/Bind/Structures/Parameter.cs b/Source/Bind/Structures/Parameter.cs index c1ab7556..94ccae49 100644 --- a/Source/Bind/Structures/Parameter.cs +++ b/Source/Bind/Structures/Parameter.cs @@ -192,6 +192,17 @@ namespace Bind.Structures #endregion + #region public string ComputeSize + + string computeSize; + public string ComputeSize + { + get { return computeSize; } + set { computeSize = value; } + } + + #endregion + #region Static Members // Returns the FlowDirection that matches the specified string diff --git a/Source/Bind/XmlSpecReader.cs b/Source/Bind/XmlSpecReader.cs index 7f247ef6..e98e8f34 100644 --- a/Source/Bind/XmlSpecReader.cs +++ b/Source/Bind/XmlSpecReader.cs @@ -312,6 +312,14 @@ namespace Bind } } } + + p.ComputeSize = param.GetAttribute("count", String.Empty).Trim(); + if (p.ComputeSize.StartsWith("COMPSIZE")) + { + //remove the compsize hint, just keep comma delimited param names + var len = "COMPSIZE(".Length; + p.ComputeSize = p.ComputeSize.Substring(len, (p.ComputeSize.Length - len) - 1); + } p.Flow = Parameter.GetFlowDirection(param.GetAttribute("flow", String.Empty).Trim());