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

Method setStackStringValue

Engine/source/console/consoleInternal.cpp:563–603  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

561
562
563void ConsoleValue::setStackStringValue(const char *value)
564{
565 if (value == NULL) value = typeValueEmpty;
566
567 if(type <= ConsoleValue::TypeInternalString)
568 {
569 // sval might still be temporarily present so we need to check and free it
570 if (bufferLen > 0)
571 {
572 dFree(sval);
573 bufferLen = 0;
574 }
575
576 if (value == typeValueEmpty)
577 {
578 sval = typeValueEmpty;
579 fval = 0.f;
580 ival = 0;
581 type = TypeInternalString;
582 return;
583 }
584
585 U32 stringLen = dStrlen(value);
586 if(stringLen < 256)
587 {
588 fval = dAtof(value);
589 ival = dAtoi(value);
590 }
591 else
592 {
593 fval = 0.f;
594 ival = 0;
595 }
596
597 type = TypeInternalStackString;
598 sval = (char*)value;
599 bufferLen = 0;
600 }
601 else
602 Con::setData(type, dataPtr, 0, 1, &value, enumTable);
603}
604
605void ConsoleValue::setStringStackPtrValue(StringStackPtr ptrValue)
606{

Callers 8

callOnChildrenMethod · 0.80
callMethod · 0.80
callMethod · 0.80
callMethod · 0.80
pushVarMethod · 0.80
pushStackStringMethod · 0.80
readConnectRequestMethod · 0.80

Calls 5

setDataFunction · 0.85
dAtofFunction · 0.70
dAtoiFunction · 0.70
dFreeFunction · 0.50
dStrlenFunction · 0.50

Tested by

no test coverage detected