Date: Tue, 1 Jul 1997 18:01:50 -0400 (EDT) From: Timothy Robb To: djgpp AT delorie DOT com Subject: getting a dir listing Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk Here's some code that is for a c++ class that will give you a directory listing (should) under Borland C++. It uses STL, btw what does "using namespace std;" do? My question is can someone re-write the member functions such that they will work under djgpp. Thanks in advance Timothy Robb // filelist.h #include #include #include using namespace std; class filelist : public vector { public: filelist(const char* afn = "*.*"); void listall(ostream &os = cout, const char *sep = "\n"); }; // filelist.cxx -- member function definitions #include "filelist.h" #include // dos directory functions for Borland filelist::filelist(const char *afn) { ffblk fileinfo; int done = findfirst(afn, &fileinfo, 0); while(!done) { push_back(fileinfo.ff_name); done = findnext(&fileinfo); } } void filelist::listall(ostream &os, const char *sep) { for(iterator i = begin(), i != end(); i++) os << (*i).c_str() << sep; }