1
0
Fork 0

APIDump: Constructors are renamed and can have documentation

This commit is contained in:
madmaxoft 2013-09-13 16:04:32 +02:00
parent af8f7eb963
commit d2deb381c2
2 changed files with 7 additions and 2 deletions

View File

@ -43,6 +43,7 @@ g_APIDesc =
]],
Functions =
{
constructor = { Params = "", Return = "cBlockArea", Notes = "Creates a new empty cBlockArea object" },
Clear = { Params = "", Return = "", Notes = "Clears the object, resets it to zero size" },
CopyFrom = { Params = "BlockAreaSrc", Return = "", Notes = "Copies contents from BlockAreaSrc into self" },
CopyTo = { Params = "BlockAreaDst", Return = "", Notes = "Copies contents from self into BlockAreaDst." },

View File

@ -246,8 +246,12 @@ function ReadDescriptions(a_API)
if (APIDesc.Functions ~= nil) then
-- Assign function descriptions:
for j, func in ipairs(cls.Functions) do
-- func is {"FuncName"}, add Parameters, Return and Notes from g_APIDesc
local FnDesc = APIDesc.Functions[func.Name];
local FnName = func.Name;
if (FnName == ".call") then
FnName = "constructor";
func.Name = "() <i>(constructor)</i>";
end
local FnDesc = APIDesc.Functions[FnName];
if (FnDesc ~= nil) then
func.Params = FnDesc.Params;
func.Return = FnDesc.Return;