i'm working on designing fast file read program in c/c++ retrieve each file in directory in order stored (created). im using sfml , boost program return files in random order. suppose has b-tree ordering of files? how boost return files in order in created?
here relevant part of code:
#include <string> #include <iostream> #include <boost/filesystem.hpp> #include "sfml/graphics.hpp" using std::cout; using namespace boost::filesystem; using namespace std; .... path p (argv[1]); .... (directory_entry& x : directory_iterator(p)){ .... fullpathname = x.path().string(); filename = x.path().filename().string(); stem = x.path().stem().string(); seqnum = stem.substr(4,5); extn = x.path().extension().string(); cout << fullpathname << ", " << filename << ", " << stem << ", " << seqnum << ", " << extn <<'\n'; }
here sample output:
../takes/test/snap00179.png, snap00179.png, snap00179, 00179, .png ../takes/test/snap00321.png, snap00321.png, snap00321, 00321, .png ../takes/test/snap00094.png, snap00094.png, snap00094, 00094, .png ../takes/test/snap00121.png, snap00121.png, snap00121, 00121, .png ../takes/test/snap00026.png, snap00026.png, snap00026, 00026, .png ../takes/test/snap00024.png, snap00024.png, snap00024, 00024, .png ../takes/test/snap00155.png, snap00155.png, snap00155, 00155, .png ../takes/test/snap00065.png, snap00065.png, snap00065, 00065, .png ../takes/test/snap00015.png, snap00015.png, snap00015, 00015, .png ../takes/test/snap00075.png, snap00075.png, snap00075, 00075, .png ../takes/test/snap00017.png, snap00017.png, snap00017, 00017, .png
Comments
Post a Comment