|
Boost Users : |
From: Dan Thill (dgt_at_[hidden])
Date: 2007-06-06 09:02:34
Thank you for the fast reply, Robert.
> Another idea is to cast your character array to a ...
> character array - like static_cast< int [64] &>(my array address)
> but that would require a constant size which might not work
> for you.
I'm not certain I quite understand this. Perhaps I didn't get my
thoughts down coherently. I'm seeking to write my serialization like
this (sorry I forgot to include this in my initial msg):
char some_array[5] = "test";
....
ar & make_nvp("some_array", make_char_array(some_array, 5));
And obtain the following output:
output.xml:
...
<some_array>test</some_array>
output.txt:
.... 4 test ....
---------------------------
My aforementioned make_char_array() works fine for text archives--just
not when the result is composed with make_nvp().
> Finally you can use the blunt instrument approach.
>
> save(....
> std::string temp_string;
> // copy data into temp_string
> ar << temp_string
>
> load
> .. do the opposite.
Which is pretty much what my serialization wrapper is doing (this is in
fact, what I wrote initially, before trying to make it a serialization
wrapper). While I can certainly do the blunt approach, it will require
me to split my serialization function :(
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net