Changeset 7624 in orxonox.OLD for branches/qt_gui/src/lib/util/directory.h
- Timestamp:
- May 16, 2006, 9:04:24 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/qt_gui/src/lib/util/directory.h
r7610 r7624 1 /*! 2 * @file directory.h 3 * @brief Definition of the Directory Handler class 4 */ 5 6 1 7 /** 2 8 * Copyright (C) 2002 Bart Vanhauwaert … … 20 26 #define __DIRECTORY_H_ 21 27 22 #if defined(unix) || defined(__unix) || defined(__unix__) 23 #define OSLINK_OSDIR_POSIX 24 #elif defined(_WIN32) 25 #define OSLINK_OSDIR_WINDOWS 28 #include "file.h" 29 30 #if not defined (__WIN32__) 31 #include <sys/types.h> 32 #include <dirent.h> 26 33 #else 27 #define OSLINK_OSDIR_NOTSUPPORTED 34 #include <windows.h> 35 #include <winbase.h> 28 36 #endif 29 37 30 #include <string> 31 32 #if defined(OSLINK_OSDIR_NOTSUPPORTED) 33 #warning DIRECTORY NOT SUPPORTET 34 35 #elif defined(OSLINK_OSDIR_POSIX) 36 #include <sys/types.h> 37 #include <dirent.h> 38 39 #elif defined(OSLINK_OSDIR_WINDOWS) 40 41 /// HACK 42 #ifdef DATADIR 43 #undef DATADIR 44 #endif 45 46 #include <windows.h> 47 #include <winbase.h> 48 49 #endif 50 51 class Directory 38 class Directory : public File 52 39 { 53 40 public: … … 55 42 ~Directory(); 56 43 57 bool open(const std::string& directoryName);58 v oidclose();44 virtual bool open(const std::string& directoryName); 45 virtual bool close(); 59 46 operator void*() const { return willfail ? (void*)0:(void*)(-1); } 60 47 61 48 std::string next(); 62 49 50 bool create(); 51 63 52 private: 64 #if defined(OSLINK_OSDIR_POSIX)53 #if not defined(__WIN32__) 65 54 DIR* handle; 66 #el if defined(OSLINK_OSDIR_WINDOWS)67 55 #else 56 HANDLE handle; 68 57 #endif 69 58 bool willfail;
Note: See TracChangeset
for help on using the changeset viewer.