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

Method getObjectIndent

Engine/source/console/persistenceManager.cpp:655–688  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

653}
654
655char* PersistenceManager::getObjectIndent(ParsedObject* object)
656{
657 char* indent = Con::getReturnBuffer(2048);
658 indent[0] = 0;
659
660 if (!object)
661 return indent;
662
663 if (object->startLine < 0 || object->startLine >= mLineBuffer.size())
664 return indent;
665
666 const char* line = mLineBuffer[object->startLine];
667
668 if (line)
669 {
670 const char* nonSpace = line;
671
672 U32 strLen = dStrlen(line);
673
674 for (U32 i = 0; i < strLen; i++)
675 {
676 if (*nonSpace != ' ')
677 break;
678
679 nonSpace++;
680 }
681
682 dStrncpy(indent, line, nonSpace - line);
683
684 indent[nonSpace - line] = 0;
685 }
686
687 return indent;
688}
689
690void PersistenceManager::updatePositions(U32 lineNumber, U32 startPos, S32 diff)
691{

Callers

nothing calls this directly

Calls 4

getReturnBufferFunction · 0.85
dStrncpyFunction · 0.85
dStrlenFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected