c++ - std(boost)::filesystem::path number of components -
is there idiomatic way number of components in path using filesystem library? or have missed method this?
or have to, like, call parent_path() until root?
how size() method?
boost::filesystem::path p; // fill p std::cout << p.size() << std::endl; will give number of components.
also path iterators don't iterate on string of path, on components of path. should work too:
std::distance(p.begin(), p.end());
Comments
Post a Comment