* @brief Adds pAdd to pDest (just like strcat). * BUT returns a pointer to the end of the combined string * unlike strcat. * * Also, this version replaces special characters with * their escape sequence. *************************************************************/
| 350 | * their escape sequence. |
| 351 | *************************************************************/ |
| 352 | inline static char* AddXMLString(char* pDest, char const* pAdd) |
| 353 | { |
| 354 | char ch = *pAdd++ ; |
| 355 | while (ch != NUL) |
| 356 | { |
| 357 | switch (ch) |
| 358 | { |
| 359 | case '<' : |
| 360 | pDest = AddString(pDest, kLT) ; |
| 361 | break ; |
| 362 | case '>' : |
| 363 | pDest = AddString(pDest, kGT) ; |
| 364 | break ; |
| 365 | case '&' : |
| 366 | pDest = AddString(pDest, kAMP) ; |
| 367 | break ; |
| 368 | case '\"' : |
| 369 | pDest = AddString(pDest, kQUOT) ; |
| 370 | break ; |
| 371 | case '\'' : |
| 372 | pDest = AddString(pDest, kAPOS) ; |
| 373 | break ; |
| 374 | default : |
| 375 | *pDest++ = ch ; |
| 376 | } |
| 377 | |
| 378 | ch = *pAdd++ ; |
| 379 | } |
| 380 | |
| 381 | return pDest ; |
| 382 | } |
| 383 | |
| 384 | |
| 385 | /************************************************************* |
no test coverage detected