aboutsummaryrefslogtreecommitdiff
path: root/src/archive.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/archive.h')
-rw-r--r--src/archive.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/archive.h b/src/archive.h
index 7b74999..bd85113 100644
--- a/src/archive.h
+++ b/src/archive.h
@@ -12,6 +12,7 @@
12#include "bu/archivebase.h" 12#include "bu/archivebase.h"
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 16
16namespace Bu 17namespace Bu
17{ 18{
@@ -109,11 +110,28 @@ namespace Bu
109 */ 110 */
110 void readID( const void *ptr, uint32_t id ); 111 void readID( const void *ptr, uint32_t id );
111 112
113 template<typename t>
114 void setProp( const Bu::FString &sId, const t &val )
115 {
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::FString &sId )
125 {
126 return hProps.get( sId );
127 }
128
112 private: 129 private:
113 Stream &rStream; 130 Stream &rStream;
114 uint32_t nNextID; 131 uint32_t nNextID;
115 Hash<uint32_t,uint32_t> hPtrID; 132 Hash<uint32_t,uint32_t> hPtrID;
116 Hash<uint32_t,List<void **> > hPtrDest; 133 Hash<uint32_t,List<void **> > hPtrDest;
134 Hash<Bu::FString, Variant> hProps;
117 }; 135 };
118} 136}
119 137