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

Function SplitSequencePathAndName

Engine/source/ts/tsShapeConstruct.cpp:109–129  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

107}
108
109static void SplitSequencePathAndName( String& srcPath, String& srcName )
110{
111 srcName = "";
112
113 // Determine if there is a sequence name at the end of the source string, and
114 // if so, split the filename from the sequence name
115 S32 split = srcPath.find(' ', 0, String::Right);
116 S32 split2 = srcPath.find('\t', 0, String::Right);
117 if ((split == String::NPos) || (split2 > split))
118 split = split2;
119 if (split != String::NPos)
120 {
121 split2 = split + 1;
122 while ((srcPath[split2] != '\0') && dIsspace(srcPath[split2]))
123 split2++;
124
125 // now 'split' is at the end of the path, and 'split2' is at the start of the sequence name
126 srcName = srcPath.substr(split2);
127 srcPath = srcPath.erase(split, srcPath.length()-split);
128 }
129}
130
131//-----------------------------------------------------------------------------
132

Callers 2

_onLoadMethod · 0.85

Calls 5

dIsspaceFunction · 0.85
substrMethod · 0.80
findMethod · 0.45
eraseMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected