diff options
Diffstat (limited to 'ace/Dirent_Selector.cpp')
-rw-r--r-- | ace/Dirent_Selector.cpp | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/ace/Dirent_Selector.cpp b/ace/Dirent_Selector.cpp deleted file mode 100644 index c4690ee88e4..00000000000 --- a/ace/Dirent_Selector.cpp +++ /dev/null @@ -1,56 +0,0 @@ -// $Id$ - -#include "ace/Dirent_Selector.h" - -#if !defined (__ACE_INLINE__) -#include "ace/Dirent_Selector.inl" -#endif /* __ACE_INLINE__ */ - -#include "ace/OS_NS_dirent.h" -#include "ace/OS_NS_stdlib.h" - -ACE_RCSID (ace, - Dirent_Selector, - "$Id$") - -// Construction/Destruction - -ACE_Dirent_Selector::ACE_Dirent_Selector (void) - : namelist_ (0), - n_ (0) -{ -} - -ACE_Dirent_Selector::~ACE_Dirent_Selector (void) -{ - // Free up any allocated resources. - this->close(); -} - -int -ACE_Dirent_Selector::open (const ACE_TCHAR *dir, - int (*sel)(const dirent *d), - int (*cmp) (const dirent **d1, - const dirent **d2)) -{ - n_ = ACE_OS::scandir (dir, &this->namelist_, sel, cmp); - return n_; -} - -int -ACE_Dirent_Selector::close (void) -{ - for (--n_; n_ >= 0; --n_) - { -#if defined (ACE_LACKS_STRUCT_DIR) - // Only the lacking-struct-dir emulation allocates this. Native - // scandir includes d_name in the dirent struct itself. - ACE_OS::free (this->namelist_[n_]->d_name); -#endif - ACE_OS::free (this->namelist_[n_]); - } - - ACE_OS::free (this->namelist_); - this->namelist_ = 0; - return 0; -} |