MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / getArgumentsString

Method getArgumentsString

Engine/source/console/consoleInternal.cpp:1641–1727  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1639}
1640
1641String Namespace::Entry::getArgumentsString() const
1642{
1643 StringBuilder str;
1644
1645 if (mHeader)
1646 {
1647 // Parse out the argument list string supplied with the extended
1648 // function header and add default arguments as we go.
1649
1650 Vector< String > argList;
1651 Vector< String > defaultArgList;
1652
1653 sParseList(mHeader->mArgString, argList);
1654 sParseList(mHeader->mDefaultArgString, defaultArgList);
1655
1656 str.append('(');
1657
1658 const U32 numArgs = argList.size();
1659 const U32 numDefaultArgs = defaultArgList.size();
1660 const U32 firstDefaultArgIndex = numArgs - numDefaultArgs;
1661
1662 for (U32 i = 0; i < numArgs; ++i)
1663 {
1664 // Add separator if not first arg.
1665
1666 if (i > 0)
1667 str.append(',');
1668
1669 // Add type and name.
1670
1671 String name;
1672 String type;
1673
1674 sGetArgNameAndType(argList[i], type, name);
1675
1676 str.append(' ');
1677 str.append(sGetDocTypeString(type));
1678 str.append(' ');
1679 str.append(name);
1680
1681 // Add default value, if any.
1682
1683 if (i >= firstDefaultArgIndex)
1684 {
1685 str.append('=');
1686 str.append(defaultArgList[i - firstDefaultArgIndex]);
1687 }
1688 }
1689
1690 if (numArgs > 0)
1691 str.append(' ');
1692 str.append(')');
1693 }
1694 else
1695 {
1696 // No extended function header. Try to parse out the argument
1697 // list from the usage string.
1698

Callers 2

DocStringMethod · 0.80
printNamespaceEntriesMethod · 0.80

Calls 9

sParseListFunction · 0.85
sGetArgNameAndTypeFunction · 0.85
sGetDocTypeStringFunction · 0.85
getFunctionArgsMethod · 0.80
appendMethod · 0.45
sizeMethod · 0.45
isEmptyMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected