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

Function exportType

Engine/source/console/engineXMLExport.cpp:346–489  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

344//-----------------------------------------------------------------------------
345
346static void exportType( const EngineTypeInfo* type, SimXMLDocument* xml )
347{
348 // Don't export anonymous types.
349 if( !type->getTypeName()[ 0 ] )
350 return;
351
352 if( isExportFiltered( type ) )
353 return;
354
355 const char* nodeName = NULL;
356 switch( type->getTypeKind() )
357 {
358 case EngineTypeKindPrimitive:
359 nodeName = "EnginePrimitiveType";
360 break;
361
362 case EngineTypeKindEnum:
363 nodeName = "EngineEnumType";
364 break;
365
366 case EngineTypeKindBitfield:
367 nodeName = "EngineBitfieldType";
368 break;
369
370 case EngineTypeKindStruct:
371 nodeName = "EngineStructType";
372 break;
373
374 case EngineTypeKindClass:
375 nodeName = "EngineClassType";
376 break;
377
378 default:
379 return;
380 }
381
382 xml->pushNewElement( nodeName );
383
384 xml->setAttribute( "name", type->getTypeName() );
385 xml->setAttribute( "size", String::ToString( type->getInstanceSize() ) );
386 xml->setAttribute( "isAbstract", type->isAbstract() ? "1" : "0" );
387 xml->setAttribute( "isInstantiable", type->isInstantiable() ? "1" : "0" );
388 xml->setAttribute( "isDisposable", type->isDisposable() ? "1" : "0" );
389 xml->setAttribute( "isSingleton", type->isSingleton() ? "1" : "0" );
390 xml->setAttribute( "docs", getDocString( type ) );
391
392 if( type->getSuperType() )
393 xml->setAttribute( "superType", getTypeName( type->getSuperType() ) );
394
395 if( type->getEnumTable() )
396 {
397 xml->pushNewElement( "enums" );
398
399 const EngineEnumTable& table = *( type->getEnumTable() );
400 const U32 numValues = table.getNumValues();
401
402 for( U32 i = 0; i < numValues; ++ i )
403 {

Callers 1

exportScopeFunction · 0.85

Calls 15

isExportFilteredFunction · 0.85
getDocStringFunction · 0.85
getTypeNameFunction · 0.85
exportScopeFunction · 0.85
getTypeKindMethod · 0.80
pushNewElementMethod · 0.80
getInstanceSizeMethod · 0.80
isAbstractMethod · 0.80
isInstantiableMethod · 0.80
isDisposableMethod · 0.80
isSingletonMethod · 0.80
getSuperTypeMethod · 0.80

Tested by

no test coverage detected