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

Popular posts from this blog

angular - DownloadURL return null in below code -

meteor - inserting data to database gives error "insert failed: Method '/texts/insert' not found" -