mirror of
https://github.com/Ryujinx/Opentk.git
synced 2024-12-25 06:55:34 +00:00
Add required version/category and deprecation status to function summaries.
This commit is contained in:
parent
643b617362
commit
c112bcce0e
|
@ -743,8 +743,37 @@ namespace Bind.GL2
|
|||
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 = "/// <summary></summary>";
|
||||
}
|
||||
|
||||
int summary_start = doc.IndexOf("<summary>") + "<summary>".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
|
||||
{ }
|
||||
|
|
Loading…
Reference in a new issue