MCPcopy Create free account
hub / github.com/anjo76/angelscript / StringCharAt

Function StringCharAt

sdk/tests/test_feature/source/scriptstring.cpp:573–586  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

571//----------
572
573static char *StringCharAt(unsigned int i, CScriptString &str)
574{
575 if( i >= str.buffer.size() )
576 {
577 // Set a script exception
578 asIScriptContext *ctx = asGetActiveContext();
579 ctx->SetException("Out of range");
580
581 // Return a null pointer
582 return 0;
583 }
584
585 return &str.buffer[i];
586}
587
588static void StringCharAt_Generic(asIScriptGeneric *gen)
589{

Callers 1

StringCharAt_GenericFunction · 0.70

Calls 2

SetExceptionMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected