diff options
Diffstat (limited to '')
| -rw-r--r-- | src/stable/archivebinary.cpp | 41 |
1 files changed, 1 insertions, 40 deletions
diff --git a/src/stable/archivebinary.cpp b/src/stable/archivebinary.cpp index 04e80d2..f46bd28 100644 --- a/src/stable/archivebinary.cpp +++ b/src/stable/archivebinary.cpp | |||
| @@ -13,8 +13,7 @@ | |||
| 13 | 13 | ||
| 14 | Bu::ArchiveBinary::ArchiveBinary( Stream &rStream, bool bLoading ) : | 14 | Bu::ArchiveBinary::ArchiveBinary( Stream &rStream, bool bLoading ) : |
| 15 | bLoading( bLoading ), | 15 | bLoading( bLoading ), |
| 16 | rStream( rStream ), | 16 | rStream( rStream ) |
| 17 | nNextID( 1 ) | ||
| 18 | { | 17 | { |
| 19 | } | 18 | } |
| 20 | 19 | ||
| @@ -236,44 +235,6 @@ bool Bu::ArchiveBinary::isLoading() | |||
| 236 | return bLoading; | 235 | return bLoading; |
| 237 | } | 236 | } |
| 238 | 237 | ||
| 239 | uint32_t Bu::ArchiveBinary::getID( const void *ptr ) | ||
| 240 | { | ||
| 241 | if( hPtrID.has( (ptrdiff_t)ptr ) ) | ||
| 242 | return hPtrID.get( (ptrdiff_t)ptr ); | ||
| 243 | hPtrID.insert( (ptrdiff_t)ptr, nNextID ); | ||
| 244 | return nNextID++; | ||
| 245 | } | ||
| 246 | |||
| 247 | void Bu::ArchiveBinary::assocPtrID( void **ptr, uint32_t id ) | ||
| 248 | { | ||
| 249 | if( hPtrID.has( id ) ) | ||
| 250 | { | ||
| 251 | *ptr = (void *)hPtrID.get( id ); | ||
| 252 | return; | ||
| 253 | } | ||
| 254 | |||
| 255 | if( !hPtrDest.has( id ) ) | ||
| 256 | hPtrDest.insert( id, List<void **>() ); | ||
| 257 | |||
| 258 | hPtrDest[id].getValue().append( ptr ); | ||
| 259 | } | ||
| 260 | |||
| 261 | void Bu::ArchiveBinary::readID( const void *ptr, uint32_t id ) | ||
| 262 | { | ||
| 263 | hPtrID.insert( id, (ptrdiff_t)ptr ); | ||
| 264 | |||
| 265 | if( hPtrDest.has( id ) ) | ||
| 266 | { | ||
| 267 | Bu::List<void **> &l = hPtrDest.get( id ); | ||
| 268 | for( Bu::List<void **>::iterator i = l.begin(); i != l.end(); i++ ) | ||
| 269 | { | ||
| 270 | *(*i) = (void *)ptr; | ||
| 271 | } | ||
| 272 | |||
| 273 | hPtrDest.erase( id ); | ||
| 274 | } | ||
| 275 | } | ||
| 276 | |||
| 277 | void Bu::ArchiveBinary::setProperty( const Bu::Blob &rKey, const Bu::Variant &rValue ) | 238 | void Bu::ArchiveBinary::setProperty( const Bu::Blob &rKey, const Bu::Variant &rValue ) |
| 278 | { | 239 | { |
| 279 | hProps.insert( rKey, rValue ); | 240 | hProps.insert( rKey, rValue ); |
