MCPcopy Create free account
hub / github.com/GaijinEntertainment/daScript / builtin_string_slice2

Function builtin_string_slice2

src/builtin/module_builtin_string.cpp:228–234  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

226 }
227
228 char* builtin_string_slice2 ( const char *str, int start, Context * context, LineInfoArg * at ) {
229 const uint32_t strLen = stringLengthSafe ( *context, str );
230 if (!strLen)
231 return nullptr;
232 start = clamp_int((start < 0) ? (strLen + start) : start, 0, strLen);
233 return strLen > uint32_t(start) ? context->allocateString(str + start, uint32_t(strLen-start), at) : nullptr;
234 }
235
236 char* builtin_string_reverse ( const char *str, Context * context, LineInfoArg * at ) {
237 const uint32_t strLen = stringLengthSafe ( *context, str );

Callers

nothing calls this directly

Calls 3

stringLengthSafeFunction · 0.85
clamp_intFunction · 0.85
allocateStringMethod · 0.80

Tested by

no test coverage detected