Index:
[thread]
[date]
[subject]
[author]
From: Garrett Mitchener <wgm2@acpub.duke.edu>
To :
Date: 03 Mar 1999 21:45:49 -0500
Another scary story
You do not need to do sorting and filtering within the same
function, or even within the same class.
You do not need to have a class named Scandir or DirScanner,
etc. Why might that be a bad thing?
You will almost certainly need to sort a vector of some kind. (Or
use a linked list, or a self-sorting list of some kind.) However,
it does not have to be publicly visible as a raw data
structure. You can hide it behind Iterators or Visitors. What
does this get you?
There are ways to solve the scandir problem that do not involve
passing around function pointers.
There are at least two ways to implement the reversed-order flag
of sools without physically reversing the order of a vector of
file objects and without passing a flag to a sort function to
tell it increasing or deceasing order and without writing twice
as many comparison functions.
-- "Bram Stoker" :-)
Index:
[thread]
[date]
[subject]
[author]