diff options
author | Mike Buland <eichlan@xagasoft.com> | 2007-06-11 16:03:46 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2007-06-11 16:03:46 +0000 |
commit | 7ba47b5b688afd7e04b38a3e0e4aa018c10a9a59 (patch) | |
tree | 81a8afe890e7e4222d71071a03b19358e11c7a39 /src/fstring.h | |
parent | 55244c8fd50dfda9c7c434cd05fc6280204447dd (diff) | |
download | libbu++-7ba47b5b688afd7e04b38a3e0e4aa018c10a9a59.tar.gz libbu++-7ba47b5b688afd7e04b38a3e0e4aa018c10a9a59.tar.bz2 libbu++-7ba47b5b688afd7e04b38a3e0e4aa018c10a9a59.tar.xz libbu++-7ba47b5b688afd7e04b38a3e0e4aa018c10a9a59.zip |
Corrected another issue with the prefix * iterator operator in Bu::Hash, it was
still trying to use a pair internally. Also added more helpers to FString.
Diffstat (limited to '')
-rw-r--r-- | src/fstring.h | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/fstring.h b/src/fstring.h index d0307b5..7dda87c 100644 --- a/src/fstring.h +++ b/src/fstring.h | |||
@@ -138,6 +138,11 @@ namespace Bu | |||
138 | append( &cData, 1 ); | 138 | append( &cData, 1 ); |
139 | } | 139 | } |
140 | 140 | ||
141 | void prepend( const MyType & sData ) | ||
142 | { | ||
143 | prepend( sData.getStr(), sData.getSize() ); | ||
144 | } | ||
145 | |||
141 | void prepend( const chr *pData ) | 146 | void prepend( const chr *pData ) |
142 | { | 147 | { |
143 | long nLen; | 148 | long nLen; |
@@ -413,17 +418,21 @@ namespace Bu | |||
413 | clear(); | 418 | clear(); |
414 | long nLen; | 419 | long nLen; |
415 | ar >> nLen; | 420 | ar >> nLen; |
416 | 421 | ||
417 | Chunk *pNew = newChunk( nLen ); | 422 | if( nLen > 0 ) |
418 | ar.read( pNew->pData, nLen*sizeof(chr) ); | 423 | { |
419 | appendChunk( pNew ); | 424 | Chunk *pNew = newChunk( nLen ); |
425 | ar.read( pNew->pData, nLen*sizeof(chr) ); | ||
426 | appendChunk( pNew ); | ||
427 | } | ||
420 | } | 428 | } |
421 | else | 429 | else |
422 | { | 430 | { |
423 | flatten(); | 431 | flatten(); |
424 | 432 | ||
425 | ar << nLength; | 433 | ar << nLength; |
426 | ar.write( pFirst->pData, nLength*sizeof(chr) ); | 434 | if( nLength ) |
435 | ar.write( pFirst->pData, nLength*sizeof(chr) ); | ||
427 | } | 436 | } |
428 | } | 437 | } |
429 | 438 | ||