Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7624 in orxonox.OLD for branches/qt_gui/src/lib/util/directory.h


Ignore:
Timestamp:
May 16, 2006, 9:04:24 AM (19 years ago)
Author:
bensch
Message:

orxonox/qt_gui: directory is a File now

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
    17/**
    28 * Copyright (C) 2002 Bart Vanhauwaert
     
    2026#define __DIRECTORY_H_
    2127
    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>
    2633#else
    27 #define OSLINK_OSDIR_NOTSUPPORTED
     34 #include <windows.h>
     35 #include <winbase.h>
    2836#endif
    2937
    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
     38class Directory : public File
    5239{
    5340public:
     
    5542  ~Directory();
    5643
    57   bool open(const std::string& directoryName);
    58   void close();
     44  virtual bool open(const std::string& directoryName);
     45  virtual bool close();
    5946  operator void*() const { return willfail ? (void*)0:(void*)(-1); }
    6047
    6148  std::string next();
    6249
     50  bool create();
     51
    6352private:
    64 #if defined(OSLINK_OSDIR_POSIX)
     53#if not defined(__WIN32__)
    6554  DIR* handle;
    66 #elif defined(OSLINK_OSDIR_WINDOWS)
    67     HANDLE    handle;
     55#else
     56  HANDLE    handle;
    6857#endif
    6958  bool willfail;
Note: See TracChangeset for help on using the changeset viewer.