1 ////////////////////////////////////////////////////////////////////////////////
3 // Author: Andy Rushton
4 // Copyright: (c) Southampton University 1999-2004
5 // (c) Andy Rushton 2004-2009
6 // License: BSD License, see ../docs/license.html
8 ////////////////////////////////////////////////////////////////////////////////
9 #include "persistent_bool.hpp"
11 ////////////////////////////////////////////////////////////////////////////////
13 // bool is dumped and restored as an unsigned char
14 void stlplus::dump_bool(stlplus::dump_context
& context
, const bool& data
) throw(stlplus::persistent_dump_failed
)
16 context
.put((unsigned char)data
);
19 void stlplus::restore_bool(restore_context
& context
, bool& data
) throw(stlplus::persistent_restore_failed
)
21 data
= context
.get() != 0;
24 ////////////////////////////////////////////////////////////////////////////////