From 819ff3d27012b4ec4a0a21c150c112a4dd28b14d Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Mon, 18 Apr 2022 21:58:01 -0700 Subject: ArchiveBase has getProperty and setProperty. I kind of want to re-engineer the entire archive system...The root should be able to track a stateful stack of containers such as arrays and dictionaries as well as support non-binary reads and writes in a more robust way. It also still bothers me that it's the only thing in the system with base in the base class name. I should just change it...it's going to impact many programs, though. --- src/stable/archive.h | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) (limited to 'src/stable/archive.h') diff --git a/src/stable/archive.h b/src/stable/archive.h index 7f988eb..b6cc2a9 100644 --- a/src/stable/archive.h +++ b/src/stable/archive.h @@ -13,6 +13,7 @@ #include "bu/hash.h" #include "bu/util.h" #include "bu/variant.h" +#include "bu/blob.h" namespace Bu { @@ -110,28 +111,16 @@ namespace Bu */ void readID( const void *ptr, uint32_t id ); - template - void setProp( const Bu::String &sId, const t &val ) - { - if( !hProps.has( sId ) ) - { - hProps.insert( sId, Variant() ); - } - hProps.get( sId ) = val; - } - - template - t getProp( const Bu::String &sId ) - { - return hProps.get( sId ); - } + virtual void setProperty( const Bu::Blob &rKey, + const Bu::Variant &rValue ); + virtual Bu::Variant getProperty( const Bu::Blob &rKey ) const; private: Stream &rStream; uint32_t nNextID; Hash hPtrID; Hash > hPtrDest; - Hash hProps; + Hash hProps; }; } -- cgit v1.2.3