Boost Users :
Subject: Re: [Boost-users] Help is required to get the file names in a directory...........
From: Sean Farrow (sean.farrow_at_[hidden])
Date: 2011-07-11 09:32:45
Where you are adding file names to the vector call the generic_string method of the file name object, and this should work.
From: boost-users-bounces_at_[hidden] [mailto:boost-users-bounces_at_[hidden]] On Behalf Of Amanullah Yasin
Sent: 11 July 2011 13:19
Subject: [Boost-users] Help is required to get the file names in a directory...........
Before, with boost 1.38 and visual studio 2005, i was using following funtion to retrieve the file names in a folder.
Now i switched to boot 1.46.1 and visual studio 2010, but the following method is not working. Please guide me.
void Compilation::getFileNames(vector<string>& listOfFiles)
for(; iterator != boost::filesystem::directory_iterator(); ++iterator)
cout << (iterator->path().filename())<< endl;
error: error C2440: 'initializing' : cannot convert from 'boost::filesystem3::path' to 'std::basic_string<_Elem,_Traits,_Ax>'
Thanks in advance.
Always have your stuff when you need it with @Dropbox. 2GB account is free! http://db.tt/xOEJ2Ag
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