diff options
Diffstat (limited to 'src/fstring.h')
| -rw-r--r-- | src/fstring.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/fstring.h b/src/fstring.h index b4cae3a..620b312 100644 --- a/src/fstring.h +++ b/src/fstring.h | |||
| @@ -390,6 +390,24 @@ namespace Bu | |||
| 390 | return pFirst->pData; | 390 | return pFirst->pData; |
| 391 | } | 391 | } |
| 392 | 392 | ||
| 393 | MyType getSubStr( long iStart, long iSize=-1 ) const | ||
| 394 | { | ||
| 395 | if( iStart < 0 ) | ||
| 396 | iStart = 0; | ||
| 397 | if( iStart >= nLength ) | ||
| 398 | return ""; | ||
| 399 | if( iSize < 0 ) | ||
| 400 | iSize = nLength; | ||
| 401 | if( iStart+iSize > nLength ) | ||
| 402 | iSize = nLength-iStart; | ||
| 403 | if( iSize == 0 ) | ||
| 404 | return ""; | ||
| 405 | |||
| 406 | flatten(); | ||
| 407 | MyType ret( pFirst->pData+iStart, iSize ); | ||
| 408 | return ret; | ||
| 409 | } | ||
| 410 | |||
| 393 | /** | 411 | /** |
| 394 | * (std::string compatability) Get a pointer to the string array. | 412 | * (std::string compatability) Get a pointer to the string array. |
| 395 | *@returns (chr *) The string data. | 413 | *@returns (chr *) The string data. |
