Just had a quick look in my snippets directory. Found this:
vector<CStdString> filenames;
CStdString directoryPath("C:\\foo\\bar\\baz\\*");
WIN32_FIND_DATA FindFileData;
HANDLE hFind = INVALID_HANDLE_VALUE;
hFind = FindFirstFile(directoryPath, &FindFileData);
if(hFind != INVALID_HANDLE_VALUE)
{
do
{
if(FindFileData.dwFileAttributes != FILE_ATTRIBUTE_DIRECTORY)
filenames.push_back(FindFileData.cFileName);
} while(FindNextFile(hFind, &FindFileData));
FindClose(hFind);
}
Gives you a vector with all filenames in a directory. Only works on windows of course.