mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-14 16:14:38 +00:00
Improve console dump with additional information, such as array sizes and variadic function
This commit is contained in:
parent
4f78143dc8
commit
ae6b035f10
2 changed files with 27 additions and 7 deletions
|
|
@ -185,7 +185,7 @@ void printGroupStart(const char * aName, const char * aDocs)
|
||||||
Con::printf(" /*! */");
|
Con::printf(" /*! */");
|
||||||
}
|
}
|
||||||
|
|
||||||
void printClassMember(const bool isDeprec, const char * aType, const char * aName, const char * aDocs)
|
void printClassMember(const bool isDeprec, const char * aType, const char * aName, const char * aDocs, S32 aElementCount)
|
||||||
{
|
{
|
||||||
Con::printf(" /*!");
|
Con::printf(" /*!");
|
||||||
|
|
||||||
|
|
@ -200,7 +200,14 @@ void printClassMember(const bool isDeprec, const char * aType, const char * aNam
|
||||||
|
|
||||||
Con::printf(" */");
|
Con::printf(" */");
|
||||||
|
|
||||||
Con::printf(" %s %s;", isDeprec ? "deprecated" : aType, aName);
|
if (aElementCount == 1)
|
||||||
|
{
|
||||||
|
Con::printf(" %s %s;", isDeprec ? "deprecated" : aType, aName);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Con::printf(" %s %s[%i];", isDeprec ? "deprecated" : aType, aName, aElementCount);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void printGroupEnd()
|
void printGroupEnd()
|
||||||
|
|
@ -235,8 +242,17 @@ void Namespace::printNamespaceEntries(Namespace * g, bool dumpScript, bool dumpE
|
||||||
// If it's a function
|
// If it's a function
|
||||||
if( eType >= Entry::ConsoleFunctionType )
|
if( eType >= Entry::ConsoleFunctionType )
|
||||||
{
|
{
|
||||||
printClassMethod(true, typeNames[eType], funcName, ewalk->getArgumentsString().c_str(),
|
if (ewalk->mHeader != NULL)
|
||||||
ewalk->getDocString().c_str());
|
{
|
||||||
|
// The function was defined with types, so we can print out the actual return type
|
||||||
|
printClassMethod(true, ewalk->mHeader->mReturnString, funcName, ewalk->getArgumentsString().c_str(),
|
||||||
|
ewalk->getDocString().c_str());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
printClassMethod(true, typeNames[eType], funcName, (ewalk->getArgumentsString() + "...").c_str(),
|
||||||
|
ewalk->getDocString().c_str());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if(ewalk->mType == Entry::GroupMarker)
|
else if(ewalk->mType == Entry::GroupMarker)
|
||||||
{
|
{
|
||||||
|
|
@ -416,7 +432,8 @@ void Namespace::dumpClasses( bool dumpScript, bool dumpEngine )
|
||||||
true,
|
true,
|
||||||
"<deprecated>",
|
"<deprecated>",
|
||||||
(*fieldList)[j].pFieldname,
|
(*fieldList)[j].pFieldname,
|
||||||
(*fieldList)[j].pFieldDocs
|
(*fieldList)[j].pFieldDocs,
|
||||||
|
(*fieldList)[j].elementCount
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -427,7 +444,8 @@ void Namespace::dumpClasses( bool dumpScript, bool dumpEngine )
|
||||||
false,
|
false,
|
||||||
cbt ? cbt->getTypeClassName() : "<unknown>",
|
cbt ? cbt->getTypeClassName() : "<unknown>",
|
||||||
(*fieldList)[j].pFieldname,
|
(*fieldList)[j].pFieldname,
|
||||||
(*fieldList)[j].pFieldDocs
|
(*fieldList)[j].pFieldDocs,
|
||||||
|
(*fieldList)[j].elementCount
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1607,8 +1607,10 @@ namespace {
|
||||||
|
|
||||||
if (dStrcmp(nativeType, "char*") == 0 || dStrcmp(nativeType, "char *") == 0)
|
if (dStrcmp(nativeType, "char*") == 0 || dStrcmp(nativeType, "char *") == 0)
|
||||||
return "string";
|
return "string";
|
||||||
else if (dStrcmp(nativeType, "S32") == 0 || dStrcmp(nativeType, "U32") == 0)
|
else if (dStrcmp(nativeType, "S32") == 0)
|
||||||
return "int";
|
return "int";
|
||||||
|
else if (dStrcmp(nativeType, "U32") == 0)
|
||||||
|
return "uint";
|
||||||
else if (dStrcmp(nativeType, "F32") == 0)
|
else if (dStrcmp(nativeType, "F32") == 0)
|
||||||
return "float";
|
return "float";
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue