MCPcopy Create free account
hub / github.com/MariaDB/server / Escape

Method Escape

storage/connect/json.cpp:389–414  ·  view source on GitHub ↗

/ Escape and Concatenate a string to the Serialize string. */ /

Source from the content-addressed store, hash-verified

387/* Escape and Concatenate a string to the Serialize string. */
388/***********************************************************************/
389bool JOUTSTR::Escape(const char* s)
390{
391 if (s) {
392 WriteChr('"');
393
394 for (unsigned int i = 0; s[i]; i++)
395 switch (s[i]) {
396 case '"':
397 case '\\':
398 case '\t':
399 case '\n':
400 case '\r':
401 case '\b':
402 case '\f': WriteChr('\\');
403 // fall through
404 default:
405 WriteChr(s[i]);
406 break;
407 } // endswitch s[i]
408
409 WriteChr('"');
410 } else
411 WriteStr("null");
412
413 return false;
414} // end of Escape
415
416/* ------------------------- Class JOUTFILE -------------------------- */
417

Callers 2

SerializeValueMethod · 0.80
SerializeValueMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected