]> Dogcows Code - chaz/yoink/blob - src/stlplus/persistence/persistent_cstring.hpp
8e3e94a62ae2a3189da994391285d6045d8c4700
[chaz/yoink] / src / stlplus / persistence / persistent_cstring.hpp
1 #ifndef STLPLUS_PERSISTENT_CSTRING
2 #define STLPLUS_PERSISTENT_CSTRING
3 ////////////////////////////////////////////////////////////////////////////////
4
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
9
10 // Persistence of C-style char* strings
11
12 // These are handled differently to other pointer types
13
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.
16
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.
23
24 ////////////////////////////////////////////////////////////////////////////////
25
26 #include "persistence_fixes.hpp"
27 #include "persistent_contexts.hpp"
28
29 ////////////////////////////////////////////////////////////////////////////////
30
31 namespace stlplus
32 {
33
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);
36
37 } // end namespace stlplus
38
39 ////////////////////////////////////////////////////////////////////////////////
40 #endif
This page took 0.028481 seconds and 3 git commands to generate.