From da6ebe9bd659916122ee973818c3d1f98ce2e007 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Thu, 16 Aug 2007 22:43:17 +0000 Subject: Lists now archive. Yippie! --- src/archive.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'src') diff --git a/src/archive.h b/src/archive.h index a2d4c8f..2d652ec 100644 --- a/src/archive.h +++ b/src/archive.h @@ -207,6 +207,35 @@ namespace Bu return ar; } + + template + Archive &operator<<( Archive &ar, List &h ) + { + ar << h.getSize(); + for( typename List::iterator i = h.begin(); i != h.end(); i++ ) + { + ar << (*i); + } + + return ar; + } + + template + Archive &operator>>( Archive &ar, List &h ) + { + h.clear(); + uint32_t nSize; + ar >> nSize; + + for( uint32_t j = 0; j < nSize; j++ ) + { + value v; + ar >> v; + h.append( v ); + } + + return ar; + } } #endif -- cgit v1.2.3