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

Function StringCopy

Templates/Full/web/source/common/webCommon.cpp:585–610  ·  view source on GitHub ↗

simple string copy that eats white space

Source from the content-addressed store, hash-verified

583
584 //simple string copy that eats white space
585 void StringCopy(char* dst, const char* src, int count)
586 {
587 int i, j;
588 bool eat = true;
589 for (i = 0, j = 0; i < count ; i++)
590 {
591 if (src[i] == 0)
592 {
593 dst[j] = 0;
594 return;
595 }
596 if (src[i] != '"' && src[i] != '\t' && src[i] != '\n' && src[i] != ')' && src[i] != '(')
597 {
598 if (eat && src[i] == ' ')
599 continue;
600
601 if (src[i] == '\'')
602 {
603 eat = !eat;
604 continue;
605 }
606
607 dst[j++] = src[i];
608 }
609 }
610 }
611
612 void SetVariable(const char* variable, const char* value)
613 {

Callers 2

callScriptMethod · 0.50
CallScriptFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected