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

Method write

Engine/source/console/simSet.cpp:360–394  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

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