From c112bcce0ecbfcef5ecf20637931c1f6f4963a39 Mon Sep 17 00:00:00 2001 From: the_fiddler Date: Wed, 13 Oct 2010 23:10:32 +0000 Subject: [PATCH] Add required version/category and deprecation status to function summaries. --- Source/Bind/GL2/Generator.cs | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/Source/Bind/GL2/Generator.cs b/Source/Bind/GL2/Generator.cs index ccca00c5..23b5da28 100644 --- a/Source/Bind/GL2/Generator.cs +++ b/Source/Bind/GL2/Generator.cs @@ -742,9 +742,38 @@ namespace Bind.GL2 file = Settings.FunctionPrefix + f.TrimmedName + ".xml"; if (!docfiles.ContainsKey(file)) file = Settings.FunctionPrefix + f.TrimmedName.TrimEnd(numbers) + ".xml"; - + + string doc = null; if (docfiles.ContainsKey(file)) - sw.WriteLine(processor.ProcessFile(docfiles[file])); + { + doc = processor.ProcessFile(docfiles[file]); + } + if (doc == null) + { + doc = "/// "; + } + + int summary_start = doc.IndexOf("") + "".Length; + string warning = "[deprecated: v{0}]"; + string category = "[requires: {0}]"; + if (f.Deprecated) + { + warning = String.Format(warning, f.DeprecatedVersion); + doc = doc.Insert(summary_start, warning); + } + + if (f.Extension != "Core" && !String.IsNullOrEmpty(f.Category)) + { + category = String.Format(category, f.Category); + doc = doc.Insert(summary_start, category); + } + else if (!String.IsNullOrEmpty(f.Version)) + { + category = String.Format(category, "v" + f.Version); + doc = doc.Insert(summary_start, category); + } + + sw.WriteLine(doc); } catch { }