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

Function sGetArgNameAndType

Engine/source/console/consoleInternal.cpp:1552–1578  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1550
1551 ///
1552 void sGetArgNameAndType( const String& str, String& outType, String& outName )
1553 {
1554 if( !str.length() )
1555 {
1556 outType = String::EmptyString;
1557 outName = String::EmptyString;
1558 return;
1559 }
1560
1561 // Find first non-ID character from right.
1562
1563 S32 index = str.length() - 1;
1564 while( index >= 0 && ( dIsalnum( str[ index ] ) || str[ index ] == '_' ) )
1565 index --;
1566
1567 const U32 nameStartIndex = index + 1;
1568
1569 // Find end of type name by skipping rightmost whitespace inwards.
1570
1571 while( index >= 0 && dIsspace( str[ index ] ) )
1572 index --;
1573
1574 //
1575
1576 outName = String( &( ( const char* ) str )[ nameStartIndex ] );
1577 outType = String( str, index + 1 );
1578 }
1579
1580 /// Return the type name to show in documentation for the given C++ type.
1581 const char* sGetDocTypeString( const char* nativeType )

Callers 1

getArgumentsStringMethod · 0.85

Calls 4

dIsalnumFunction · 0.85
dIsspaceFunction · 0.85
StringClass · 0.70
lengthMethod · 0.45

Tested by

no test coverage detected