I continue to use the same C++ libraries for COTS software that we use in my company. Their help files aren't great and when I send queries directly to the company it can be weeks or possibly months before I get a response. This, I think, is a simple problem that I'm hoping anyone who is handy at c++ (ie not me) can have a stab at answering.
I want to get a list of files in a directory that have the file extension 'ext'. I'm pretty sure that I want to use their library function dir_list() with a filter that only include files that have if the last 4 characters as ".ext". However, from their comments, I can't work out how to define this filter function or use it in dir_list(). Can anyone give me some hints, please? Yes, I can work around this, but it would be nice to use what is in the toolbox.
// Function to act as a filter to a directory list.
// This function must return True if a member of the list
// has past the criterion, and False if a member is to
// be excluded from the list due to failure to pass the
// filter criteria.
typedef bool (*filter_func)(const char[], const char[]);
void dir_list(
StringList &file_list, // List of files (returned)
const char dir[], // Directory to scan
filter_func filter = NULL // Filter function
);