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

Method getArgumentsString

Engine/source/console/consoleInternal.cpp:1646–1732  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

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