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

Method getDirectory

Engine/source/core/util/path.cpp:393–415  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

391}
392
393String Path::getDirectory(U32 count) const
394{
395 if (mPath.isEmpty())
396 return String();
397
398 U32 offset = 0;
399
400 if (mPath.c_str()[0] == '/')
401 offset++;
402
403 while (count && offset < mPath.length())
404 {
405 if (mPath[offset++] == '/')
406 count--;
407 }
408
409 U32 end = offset;
410
411 while (end < mPath.length() && mPath[end] != '/')
412 end++;
413
414 return mPath.substr(offset,end - offset);
415}
416
417//-----------------------------------------------------------------------------
418

Callers 4

_dumpDirectoriesMethod · 0.80
createPathMethod · 0.80
MakeRelativePathMethod · 0.80
getFolderPrefixedNameMethod · 0.80

Calls 5

substrMethod · 0.80
StringClass · 0.70
isEmptyMethod · 0.45
c_strMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected