character set used in boost serialization

Hi, I am using boost serialization text_oarchive to serialize data objects into text strings, and then I need to delimit several of these serialized strings and concatenate them into an ascii text. So obvious I want to choose a delimiter (currently using 0x01) not used by boost serialization. My question is how do I find the character set used by boost serialization so that whatever I choose for my delimiter would not shows up in text_oarchive's result? Thx. --------------------------------- Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.

Since a std:string and std:wstring could contain any character, there is no way go guarentee that any specific character would not be used. I'm not sure why you want to do this. maybe you would like to use a string stream and serialize the data into that. The you could use a string stream to load it and you would already have what you wanted. { fstream os; text_oarchive oa(os); oa<< my_complicated_class_instance; oa << another_complicated_class_instance; } { stringstream is text_iarchive ia(is); ia >> my_complicated_class_instance; std::string first; first = is.?string; is.string.clear(); ia >> another_complicated_class_instance std::sting second; second = is.?string } Robert Ramey X Wang wrote:
Hi, I am using boost serialization text_oarchive to serialize data objects into text strings, and then I need to delimit several of these serialized strings and concatenate them into an ascii text. So obvious I want to choose a delimiter (currently using 0x01) not used by boost serialization. My question is how do I find the character set used by boost serialization so that whatever I choose for my delimiter would not shows up in text_oarchive's result?
Thx.
--------------------------------- Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

What I want is to concatenate some of my own data (all printable strings, delimited by some char, say 0x01) and append serialized data (from different modules, treated as a black box) to it. For this reason, I need a delimiter(hopefully from ascii set) which is not in serialized charater set so I could figure out the boundary and decode the whole string later. What you suggested would work, just the setup becomes less straightforward for my case. Thx. Robert Ramey <ramey@rrsd.com> wrote: Since a std:string and std:wstring could contain any character, there is no way go guarentee that any specific character would not be used. I'm not sure why you want to do this. maybe you would like to use a string stream and serialize the data into that. The you could use a string stream to load it and you would already have what you wanted. { fstream os; text_oarchive oa(os); oa<< my_complicated_class_instance; oa << another_complicated_class_instance; } { stringstream is text_iarchive ia(is); ia >> my_complicated_class_instance; std::string first; first = is.?string; is.string.clear(); ia >> another_complicated_class_instance std::sting second; second = is.?string } Robert Ramey X Wang wrote:
Hi, I am using boost serialization text_oarchive to serialize data objects into text strings, and then I need to delimit several of these serialized strings and concatenate them into an ascii text. So obvious I want to choose a delimiter (currently using 0x01) not used by boost serialization. My question is how do I find the character set used by boost serialization so that whatever I choose for my delimiter would not shows up in text_oarchive's result?
Thx.
--------------------------------- Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost --------------------------------- Never miss a thing. Make Yahoo your homepage.

Please don't top post or over qoute. See my comments inline below.
X Wang wrote:
Hi, I am using boost serialization text_oarchive to serialize data objects into text strings, and then I need to delimit several of these serialized strings and concatenate them into an ascii text. So ...
Robert Ramey <ramey@rrsd.com> wrote: Since a std:string and std:wstring could contain any character, there is no way go guarentee that any specific character would not be used.
...
What I want is to concatenate some of my own data ...
and append serialized data (from different modules, treated as a black box) to it.
Just serialize your strings to the archive and then serialize your other items by pass your archive to the other modules. Why over complicate things by mixing paradigms. Jeff Flinn
participants (3)
-
Jeff Flinn
-
Robert Ramey
-
X Wang