From: stephan b. <st...@s1...> - 2004-12-23 23:44:40
|
On Thursday 23 December 2004 22:52, Marc Duerner wrote: > Hello, > I still want to look at P::Prefs and some containers. Specially the > first one may benefit from s11n. Any std container is usably out of the box by s11n: #include <s11n.net/s11n/s11nlite.hpp> #include <s11n.net/s11n/list.hpp> #include <s11n.net/s11n/map.hpp> #include <s11n.net/s11n/pods_streamable.hpp> ... typedef map<string,list<map<int,string> > > Geez; Geez g; ... populate it ... bool worked = s11nlite::save( g, stream|file ); Loading has 2 options: #1: Geez * g = s11nlite::load_serializable<Geez>( stream|file ); #2: s11nlite::node_type * n = s11nlite::load_node( stream|file ); if( ! n ) { ... error ... } Geez g; bool worked= = s11nlite::deserialize( *n, g ); P::s11n works identically, but also supports URLs (whatever is supported by IOManager). -- ----- st...@s1... http://s11n.net "...pleasure is a grace and is not obedient to the commands of the will." -- Alan W. Watts |