Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

Dirent_Selector.cpp

Go to the documentation of this file.
00001 #include "ace_pch.h"
00002 // $Id: Dirent_Selector.cpp,v 1.1.1.1.40.1 2003/03/13 19:44:21 chad Exp $
00003 
00004 #include "ace/OS.h"
00005 #include "ace/Dirent_Selector.h"
00006 
00007 #if !defined (__ACE_INLINE__)
00008 #include "ace/Dirent_Selector.inl"
00009 #endif /* __ACE_INLINE__ */
00010 
00011 ACE_RCSID (ace,
00012            Dirent_Selector,
00013            "$Id: Dirent_Selector.cpp,v 1.1.1.1.40.1 2003/03/13 19:44:21 chad Exp $")
00014 
00015 // Construction/Destruction
00016 
00017 ACE_Dirent_Selector::ACE_Dirent_Selector (void)
00018   : namelist_ (0),
00019     n_ (0)
00020 {
00021 }
00022 
00023 ACE_Dirent_Selector::~ACE_Dirent_Selector (void)
00024 {
00025 }
00026 
00027 int
00028 ACE_Dirent_Selector::open (const ACE_TCHAR *dir,
00029                            int (*sel)(const dirent *d),
00030                            int (*cmp) (const dirent **d1,
00031                                        const dirent **d2))
00032 {
00033   n_ = ACE_OS::scandir (dir, &this->namelist_, sel, cmp);
00034   return n_;
00035 }
00036 
00037 int
00038 ACE_Dirent_Selector::close (void)
00039 {
00040   for (--n_; n_>=0; --n_)
00041     ACE_OS::free (this->namelist_[n_]);
00042 
00043   ACE_OS::free (this->namelist_);
00044   return 0;
00045 }

Generated on Mon Jun 16 11:19:36 2003 for ACE by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002