version 1.20, 2005/02/04 19:06:44
|
version 1.21, 2005/02/04 19:51:46
|
|
|
long file; | long file; |
struct _finddata_t findData; | struct _finddata_t findData; |
} DirRep; | } DirRep; |
#elif defined(PEGASUS_OS_SOLARIS) |
#elif defined(PEGASUS_OS_TYPE_UNIX) || defined (PEGASUS_OS_VMS) |
|
#if defined(PEGASUS_OS_SOLARIS) |
#include <sys/param.h> | #include <sys/param.h> |
#elif defined(PEGASUS_OS_VMS) |
#endif /* if defined(PEGASUS_OS_SOLARIS) */ |
#include <dirent.h> |
|
#endif |
|
| |
// ATTN: If a platform is found that does not have the readdir_r interface, |
#include <dirent.h> |
// this next line should be conditionally compiled out for that platform. |
|
// Otherwise, the old readdir code can be removed. |
|
| |
#ifndef PEGASUS_OS_VMS | #ifndef PEGASUS_OS_VMS |
#define PEGASUS_HAS_READDIR_R | #define PEGASUS_HAS_READDIR_R |
#endif |
#endif /* ifndef PEGASUS_OS_VMS */ |
| |
typedef struct | typedef struct |
{ | { |
DIR* dir; | DIR* dir; |
#ifdef PEGASUS_OS_OS400 | #ifdef PEGASUS_OS_OS400 |
struct dirent_lg* entry; | struct dirent_lg* entry; |
#else |
#else /* ifdef PEGASUS_OS_OS400 */ |
struct dirent* entry; | struct dirent* entry; |
#endif |
#endif /* ifdef PEGASUS_OS_OS400 */ |
#ifdef PEGASUS_HAS_READDIR_R | #ifdef PEGASUS_HAS_READDIR_R |
#ifdef PEGASUS_OS_OS400 | #ifdef PEGASUS_OS_OS400 |
struct dirent_lg buffer; | struct dirent_lg buffer; |
#else |
#else /* ifdef PEGASUS_OS_OS400 */ |
#ifdef PEGASUS_OS_SOLARIS | #ifdef PEGASUS_OS_SOLARIS |
private: | private: |
char buf[sizeof(dirent) + MAXNAMELEN]; | char buf[sizeof(dirent) + MAXNAMELEN]; |
|
|
inline DirRep() | inline DirRep() |
: buffer(*reinterpret_cast<struct dirent *>(buf)) | : buffer(*reinterpret_cast<struct dirent *>(buf)) |
{ } | { } |
#else |
#else /* ifdef PEGASUS_OS_SOLARIS */ |
struct dirent buffer; | struct dirent buffer; |
#endif |
#endif /* ifdef PEGASUS_OS_SOLARIS */ |
#endif |
#endif /* ifdef PEGASUS_OS_OS400 */ |
#endif |
#endif /* ifdef PEGASUS_HAS_READDIR_R */ |
} DirRep; | } DirRep; |
|
#endif /* elif defined(PEGASUS_OS_TYPE_UNIX) || defined (PEGASUS_OS_VMS) */ |
| |
/** The Dir class provides a platform independent way of iterating the | /** The Dir class provides a platform independent way of iterating the |
files in a directory. | files in a directory. |