
In the past, due to the standard's approach to treating all string extraction as ending upon encountering a space, I have tended to insert the length of the string a space and then characters. "My Name" serialized becomes "7 My Name" in >> w; // read 7 in.ignore(); // ignore space in.width( w ) // minimum extraction for string in >> s; // extract string I like this approach better than using some "sentinel" character as there's no need to perform character by character extraction one the length is known. Not to mention a path can now have a ' ', a '"', etc.... Any way you slice it, there's a problem as the serialization protocol may need to change. How will previous serialized paths be extracted? --aj On 9/22/08 11:48 AM, "Johan Råde" <rade@maths.lth.se> wrote: Scott McMurray wrote:
On Mon, Sep 22, 2008 at 14:14, Johan Råde <rade@maths.lth.se> wrote:
That sounds good, but how would it handle paths with "s in them?
$ touch '"' $ rm '"' rm: remove regular empty file `"'? y $ touch '\' $ rm '\' rm: remove regular empty file `\\'? y
~ Scott _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
I don't know. I only have experience with Windows, where spaces are common and "s are not allowed in path names. It is a common convention on Windows to surround paths, that contain spaces, by quotes. How is this problem handled on Unix? --Johan Råde _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost