/ Escape and Concatenate a string to the Serialize string. */ /
| 387 | /* Escape and Concatenate a string to the Serialize string. */ |
| 388 | /***********************************************************************/ |
| 389 | bool 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 |
no outgoing calls
no test coverage detected