1 #ifndef STLPLUS_PERSISTENT_CSTRING
2 #define STLPLUS_PERSISTENT_CSTRING
3 ////////////////////////////////////////////////////////////////////////////////
5 // Author: Andy Rushton
6 // Copyright: (c) Southampton University 1999-2004
7 // (c) Andy Rushton 2004-2009
8 // License: BSD License, see ../docs/license.html
10 // Persistence of C-style char* strings
12 // These are handled differently to other pointer types
14 // Warning! This means that pointers to char cannot be supported, since there
15 // is no type difference between a pointer to char and a C-style array of char.
17 // Warning! The restore deletes any old value of the data parameter and
18 // allocates a new char* which is (just) big enough and assigns it to the data
19 // field. This is because there is no way of knowing how long a char* is so
20 // the passed parameter is not safe to use. The allocation is done using
21 // standard new. If the data field is non-null on entry it will be deleted by
22 // standard delete. Best to make it null in the first place.
24 ////////////////////////////////////////////////////////////////////////////////
26 #include "persistence_fixes.hpp"
27 #include "persistent_contexts.hpp"
29 ////////////////////////////////////////////////////////////////////////////////
34 void dump_cstring(dump_context
&, const char* data
) throw(persistent_dump_failed
);
35 void restore_cstring(restore_context
&, char*& data
) throw(persistent_restore_failed
);
37 } // end namespace stlplus
39 ////////////////////////////////////////////////////////////////////////////////