MCPcopy Create free account
hub / github.com/GarageGames/Torque2D / getUnit

Function getUnit

engine/source/string/stringUnit.cpp:38–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36 }
37
38 const char* getUnit(const char* string, U32 index, const char* set)
39 {
40 U32 sz;
41 while(index--)
42 {
43 if(!*string)
44 return "";
45 sz = dStrcspn(string, set);
46 if (string[sz] == 0)
47 return "";
48 string += (sz + 1);
49 }
50 sz = dStrcspn(string, set);
51 if (sz == 0)
52 return "";
53
54 AssertFatal( sz + 1 < sizeof( _returnBuffer ), "Size of returned string too large for return buffer" );
55
56 char *ret = &_returnBuffer[0];
57 dStrncpy(ret, string, sz);
58 ret[sz] = '\0';
59 return ret;
60 }
61
62 const char* getUnits(const char* string, S32 startIndex, S32 endIndex, const char* set)
63 {

Callers 15

getStringTableUnitFunction · 0.70
AquariumToyFunction · 0.50
setAnimationFramesMethod · 0.50
onTamlCustomReadMethod · 0.50
setDependenciesMethod · 0.50
getDirectoryNameFunction · 0.50
visitMethod · 0.50
visitMethod · 0.50
setAssetIdFromMethod · 0.50
setAssetIdToMethod · 0.50

Calls 2

dStrcspnFunction · 0.50
dStrncpyFunction · 0.50

Tested by

no test coverage detected