On Sat, Oct 16, 2021 at 11:10 AM Phil Endecott via Boost
I would be very interested to see a comparison of how your decomposition of paths into segments, and the reverse, compares to what std::filesystem::path does, and rationale for the differences.
To be honest I have no idea, I have never used std::filesystem to any meaningful extent.
abs("/././/", { ".", "", "" });
Well that's an interesting one. Why is the middle element "" not "."? Can you clarify?
So yeah there are some basic rules. For example if you call
u.encoded_segments() = { ... }; // initializer_list
I might perhaps hope that something like this would work:
for (auto dir: path.segments) { chdir(dir.c_str()); }
I believe it will work for the cases where it should work, although I can't say with certainty until I have finished making these changes.
I believe that std::filesystem::path merges adjacent directory separators, so the "" segments disappear.
Yep, that needs to be a supported operation but it should not be called push_back or insert, because those operations which have the same names as their vector equivalent, should behave exactly like vector. And vector<string> doesn't delete a trailing "" when you push_back a non-empty string. I would have to add more functions such as (bikeshedding aside) merge_back or merge_at. Thanks