Hi Robert, Robert Ramey skrev 2011-05-28 07:45:
If you look at how serialization of string is implemented inside the library (text_primitive), you'll see the it is something like
<string length> <string characters> It has to be something like this to avoid "running over". I would think that your implemenation would have to have something similar.
With the text archive there is no problem. The problem occurs only when using the XML archive.
I've checked the xml_iarchive_impl::load impl for std::wstring and there it uses an xml_grammar
to parse out the string, which obviously is why that works. So I would need to do something like that.
Unfortunately there is no way to specialize xml_iarchive_impl::load for my string type, nor is there a way to
call xml_oarchive::save and xml_iarchive_impl::load explicitly (for std::wstring) from load/save implementations (when splitting
serialize into load/save) since they're protected.
For now I split serialize of juce::String into load/save and load/save a std::wstring (with the necessary additional tag)
<myString>