MCPcopy Create free account
hub / github.com/defold/defold / SendJsonEscapedText

Function SendJsonEscapedText

engine/engine/src/engine_service.cpp:709–730  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

707 }
708
709 static void SendJsonEscapedText(dmWebServer::Request* request, const char* text)
710 {
711 SendText(request, "\"");
712 for (const char* p = text; *p; ++p)
713 {
714 switch (*p)
715 {
716 case '\"': SendText(request, "\\\""); break;
717 case '\\': SendText(request, "\\\\"); break;
718 case '\n': SendText(request, "\\n"); break;
719 case '\r': SendText(request, "\\r"); break;
720 case '\t': SendText(request, "\\t"); break;
721 default:
722 {
723 char buf[2] = {*p, 0};
724 SendText(request, buf);
725 break;
726 }
727 }
728 }
729 SendText(request, "\"");
730 }
731
732 static float JsonSafeFloat(float f)
733 {

Callers 1

OutputJsonPropertyFunction · 0.85

Calls 1

SendTextFunction · 0.85

Tested by

no test coverage detected