aboutsummaryrefslogtreecommitdiff
path: root/src/stable/archive.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/stable/archive.h')
-rw-r--r--src/stable/archive.h21
1 files changed, 5 insertions, 16 deletions
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 @@
13#include "bu/hash.h" 13#include "bu/hash.h"
14#include "bu/util.h" 14#include "bu/util.h"
15#include "bu/variant.h" 15#include "bu/variant.h"
16#include "bu/blob.h"
16 17
17namespace Bu 18namespace Bu
18{ 19{
@@ -110,28 +111,16 @@ namespace Bu
110 */ 111 */
111 void readID( const void *ptr, uint32_t id ); 112 void readID( const void *ptr, uint32_t id );
112 113
113 template<typename t> 114 virtual void setProperty( const Bu::Blob &rKey,
114 void setProp( const Bu::String &sId, const t &val ) 115 const Bu::Variant &rValue );
115 { 116 virtual Bu::Variant getProperty( const Bu::Blob &rKey ) const;
116 if( !hProps.has( sId ) )
117 {
118 hProps.insert( sId, Variant() );
119 }
120 hProps.get( sId ) = val;
121 }
122
123 template<typename t>
124 t getProp( const Bu::String &sId )
125 {
126 return hProps.get( sId );
127 }
128 117
129 private: 118 private:
130 Stream &rStream; 119 Stream &rStream;
131 uint32_t nNextID; 120 uint32_t nNextID;
132 Hash<uint32_t,ptrdiff_t> hPtrID; 121 Hash<uint32_t,ptrdiff_t> hPtrID;
133 Hash<uint32_t,List<void **> > hPtrDest; 122 Hash<uint32_t,List<void **> > hPtrDest;
134 Hash<Bu::String, Variant> hProps; 123 Hash<Bu::Blob, Variant> hProps;
135 }; 124 };
136} 125}
137 126