Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7612 in orxonox.OLD for branches/qt_gui


Ignore:
Timestamp:
May 12, 2006, 4:19:06 PM (19 years ago)
Author:
bensch
Message:

first function

Location:
branches/qt_gui/src/lib/util
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/qt_gui/src/lib/util/file.cc

    r7611 r7612  
    7373bool File::isDirectory()
    7474{
     75  std::string tmpDirName = this->_name;
     76  struct stat status;
     77
     78  // checking for the termination of the string given. If there is a "/" at the end cut it away
     79  if (directoryName[directoryName.size()-1] == '/' ||
     80      directoryName[directoryName.size()-1] == '\\')
     81  {
     82    tmpDirName.erase(tmpDirName.size()-1);
     83  }
     84
     85  if(!stat(tmpDirName.c_str(), &status))
     86  {
     87    if (status.st_mode & (S_IFDIR
     88#ifndef __WIN32__
     89        | S_IFLNK
     90#endif
     91                         ))
     92    {
     93      return true;
     94    }
     95    else
     96      return false;
     97  }
     98  else
     99    return false;
     100}
     101
     102bool File::isReadeable()
     103{
     104
    75105#warning implement
    76106}
    77 bool File::isReadeable()
    78 {
    79 #warning implement
    80 }
     107
    81108bool File::isWriteable()
    82109{
  • branches/qt_gui/src/lib/util/file.h

    r7611 r7612  
    5454  private:
    5555    int                 _handle;          //!< The FileHandle (if set).
    56     std::string         name;             //!< The Name of the File.
     56    std::string         _name;             //!< The Name of the File.
    5757
    5858    static std::string  _cwd;             //!< The currend Working directory.
Note: See TracChangeset for help on using the changeset viewer.