diff options
| author | Mike Buland <eichlan@xagasoft.com> | 2009-08-11 14:55:17 +0000 | 
|---|---|---|
| committer | Mike Buland <eichlan@xagasoft.com> | 2009-08-11 14:55:17 +0000 | 
| commit | cb219e9b51f3436b9fb6d63a2c7a05333e4c86ed (patch) | |
| tree | d05fe35c8d00387c1fb82d162b3058f9017ed455 /src/fbasicstring.h | |
| parent | 4e86c50016ecfea40a72930cdd0460143f9edf4a (diff) | |
| download | libbu++-cb219e9b51f3436b9fb6d63a2c7a05333e4c86ed.tar.gz libbu++-cb219e9b51f3436b9fb6d63a2c7a05333e4c86ed.tar.bz2 libbu++-cb219e9b51f3436b9fb6d63a2c7a05333e4c86ed.tar.xz libbu++-cb219e9b51f3436b9fb6d63a2c7a05333e4c86ed.zip | |
Added some more functions to Bu::FBasicString, including a setSize function.
Also added some awesome helpers to Bu::FString in the form of << operators to
convert a string to many common types.  Handy.
Diffstat (limited to 'src/fbasicstring.h')
| -rw-r--r-- | src/fbasicstring.h | 21 | 
1 files changed, 21 insertions, 0 deletions
| diff --git a/src/fbasicstring.h b/src/fbasicstring.h index fbfc5ef..33a82cb 100644 --- a/src/fbasicstring.h +++ b/src/fbasicstring.h | |||
| @@ -1226,6 +1226,19 @@ namespace Bu | |||
| 1226 | append( s, e ); | 1226 | append( s, e ); | 
| 1227 | } | 1227 | } | 
| 1228 | 1228 | ||
| 1229 | /** | ||
| 1230 | * Resize the string, possibly to make room for a copy. At the moment | ||
| 1231 | * this operation *is* destructive. What was in the string will in no | ||
| 1232 | * way be preserved. | ||
| 1233 | *@param iSize the new size in bytes. The string is guranteed to have | ||
| 1234 | * at least this much contiguous space available when done. | ||
| 1235 | */ | ||
| 1236 | void setSize( long iSize ) | ||
| 1237 | { | ||
| 1238 | clear(); | ||
| 1239 | appendChunk( newChunk( iSize ) ); | ||
| 1240 | } | ||
| 1241 | |||
| 1229 | void expand() | 1242 | void expand() | 
| 1230 | { | 1243 | { | 
| 1231 | flatten(); | 1244 | flatten(); | 
| @@ -1520,6 +1533,14 @@ namespace Bu | |||
| 1520 | } | 1533 | } | 
| 1521 | } | 1534 | } | 
| 1522 | 1535 | ||
| 1536 | // template<typename out> | ||
| 1537 | // void to( out &dst ); | ||
| 1538 | /* { | ||
| 1539 | flatten(); | ||
| 1540 | |||
| 1541 | dst = strtol( pFirst->pData, NULL, 0 ); | ||
| 1542 | } */ | ||
| 1543 | |||
| 1523 | const_iterator find( const chr cChar, | 1544 | const_iterator find( const chr cChar, | 
| 1524 | const_iterator iStart=typename MyType::const_iterator() ) const | 1545 | const_iterator iStart=typename MyType::const_iterator() ) const | 
| 1525 | { | 1546 | { | 
