mirror of
https://github.com/mangosfour/server.git
synced 2025-12-12 01:37:00 +00:00
Applied dep and realm updates
This commit is contained in:
parent
12257a5bc2
commit
5260602e28
2020 changed files with 39571 additions and 173090 deletions
55
dep/acelite/ace/Dirent_Selector.cpp
Normal file
55
dep/acelite/ace/Dirent_Selector.cpp
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
// $Id: Dirent_Selector.cpp 91286 2010-08-05 09:04:31Z johnnyw $
|
||||
|
||||
#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_BEGIN_VERSIONED_NAMESPACE_DECL
|
||||
|
||||
// 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,
|
||||
ACE_SCANDIR_SELECTOR sel,
|
||||
ACE_SCANDIR_COMPARATOR cmp)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
ACE_END_VERSIONED_NAMESPACE_DECL
|
||||
Loading…
Add table
Add a link
Reference in a new issue