3 //=============================================================================
5 * @file Dirent_Selector.h
7 * $Id: Dirent_Selector.h 80826 2008-03-04 14:51:23Z wotte $
9 * Define a portable C++ interface to the <ACE_OS_Dirent::scandir> method.
11 * @author Rich Newman <RNewman@directv.com>
13 //=============================================================================
15 #ifndef ACE_DIRENT_SELECTOR_H
16 #define ACE_DIRENT_SELECTOR_H
17 #include /**/ "ace/pre.h"
19 #include /**/ "ace/ACE_export.h"
21 #if !defined (ACE_LACKS_PRAGMA_ONCE)
23 #endif /* ACE_LACKS_PRAGMA_ONCE */
25 #include "ace/OS_NS_dirent.h" /* Need ACE_SCANDIR_SELECTOR, COMPARATOR */
26 #include "ace/os_include/os_dirent.h"
28 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
31 * @class ACE_Dirent_Selector
33 * @brief Define a portable C++ directory-entry iterator based on the
36 class ACE_Export ACE_Dirent_Selector
40 ACE_Dirent_Selector (void);
43 virtual ~ACE_Dirent_Selector (void);
45 /// Return the length of the list of matching directory entries.
46 int length (void) const;
48 /// Return the entry at @a index.
49 ACE_DIRENT
*operator[] (const int index
) const;
51 /// Free up resources.
54 /// Open the directory @a dir and populate the current list of names with
55 /// directory entries that match the @a selector and @a comparator.
56 int open (const ACE_TCHAR
*dir
,
57 ACE_SCANDIR_SELECTOR selector
= 0,
58 ACE_SCANDIR_COMPARATOR comparator
= 0);
61 /// Ptr to the namelist array.
62 ACE_DIRENT
**namelist_
;
64 /// Number of entries in the array.
68 ACE_END_VERSIONED_NAMESPACE_DECL
70 #if defined (__ACE_INLINE__)
71 #include "ace/Dirent_Selector.inl"
72 #endif /* __ACE_INLINE__ */
74 #include /**/ "ace/post.h"
75 #endif /* ACE_DIRENT_SELECTOR_H */