returns true while new lines available to be read...
| 359 | // returns true while new lines available to be read... |
| 360 | // |
| 361 | SE_BOOL CStringEdPackage::ReadLine( const char *&psParsePos, char *psDest ) |
| 362 | { |
| 363 | if (psParsePos[0]) |
| 364 | { |
| 365 | const char *psLineEnd = strchr(psParsePos, '\n'); |
| 366 | if (psLineEnd) |
| 367 | { |
| 368 | int iCharsToCopy = (psLineEnd - psParsePos); |
| 369 | strncpy(psDest, psParsePos, iCharsToCopy); |
| 370 | psDest[iCharsToCopy] = '\0'; |
| 371 | psParsePos += iCharsToCopy; |
| 372 | while (*psParsePos && strchr("\r\n",*psParsePos)) |
| 373 | { |
| 374 | psParsePos++; // skip over CR or CR/LF pairs |
| 375 | } |
| 376 | } |
| 377 | else |
| 378 | { |
| 379 | // last line... |
| 380 | // |
| 381 | strcpy(psDest, psParsePos); |
| 382 | psParsePos += strlen(psParsePos); |
| 383 | } |
| 384 | |
| 385 | // clean up the line... |
| 386 | // |
| 387 | if (psDest[0]) |
| 388 | { |
| 389 | int iWhiteSpaceScanPos = strlen(psDest)-1; |
| 390 | while (iWhiteSpaceScanPos>=0 && isspace(psDest[iWhiteSpaceScanPos])) |
| 391 | { |
| 392 | psDest[iWhiteSpaceScanPos--] = '\0'; |
| 393 | } |
| 394 | |
| 395 | REMKill( psDest ); |
| 396 | } |
| 397 | return SE_TRUE; |
| 398 | } |
| 399 | |
| 400 | return SE_FALSE; |
| 401 | } |
| 402 | |
| 403 | // remove any outside quotes from this supplied line, plus any leading or trailing whitespace... |
| 404 | // |