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

Method write

Engine/source/console/simSet.cpp:362–396  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

360//-----------------------------------------------------------------------------
361
362void SimSet::write(Stream &stream, U32 tabStop, U32 flags)
363{
364 MutexHandle handle;
365 handle.lock(mMutex);
366
367 // export selected only?
368 if((flags & SelectedOnly) && !isSelected())
369 {
370 for(U32 i = 0; i < size(); i++)
371 (*this)[i]->write(stream, tabStop, flags);
372
373 return;
374
375 }
376
377 stream.writeTabs( tabStop );
378 char buffer[ 2048 ];
379 const U32 bufferWriteLen = dSprintf( buffer, sizeof( buffer ), "new %s(%s) {\r\n", getClassName(), getName() && !( flags & NoName ) ? getName() : "" );
380 stream.write( bufferWriteLen, buffer );
381 writeFields( stream, tabStop + 1 );
382
383 if(size())
384 {
385 stream.write(2, "\r\n");
386 for(U32 i = 0; i < size(); i++)
387 {
388 SimObject* child = ( *this )[ i ];
389 if( child->getCanSave() )
390 child->write(stream, tabStop + 1, flags);
391 }
392 }
393
394 stream.writeTabs(tabStop);
395 stream.write(4, "};\r\n");
396}
397
398//-----------------------------------------------------------------------------
399

Callers 6

saveMethod · 0.45
writeFieldsMethod · 0.45
writeObjectMethod · 0.45
logFunction · 0.45
exportVariablesMethod · 0.45
compileMethod · 0.45

Calls 7

isSelectedFunction · 0.85
dSprintfFunction · 0.85
writeTabsMethod · 0.80
getCanSaveMethod · 0.80
sizeFunction · 0.50
getNameFunction · 0.50
lockMethod · 0.45

Tested by

no test coverage detected