Boost logo

Boost Users :

Subject: [Boost-users] [boost.filesystem3] directory name from a directory iterator
From: Sean Farrow (sean.farrow_at_[hidden])
Date: 2010-12-23 10:51:12


Hi:
I have the following code to iterate through sub directories:
for (boost::filesystem::directory_iterator end, dir(DirectoryToIterate); dir != end; ++dir ) {
                    if (boost::filesystem::is_directory(dir->status()))
                           TempVec.push_back(boost::filesystem::path(dir->path()).generic_wstring());
                    }
I'm getting the following output which I expect:
C:/Documents and Settings/All Users/Application Data/Freedom Scientific/JAWS/12.0/Settings/enu
I have two questions:
Firstly how do I just obtain the last directory in this case enu (with out any slashes)?
And secondly, is there a method of the path object that gives me the path in windows form (i.e with the \ character replacing the / character.)
Any help appreciated.
Cheers
Sean.



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net