/* orxonox - the future of 3D-vertical-scrollers Copyright (C) 2004 orx This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ### File Specific: main-programmer: Benjamin Grauer co-programmer: ... */ #include "file.h" #ifdef __unix__ #include #elif __WIN32__ || _MS_DOS_ #include #else #include #endif File::File() { #warning implement } File::File(const std::string& fileName) { #warning implement } File::File(const File& file) { #warning implement } File::~File() { #warning implement } bool File::open(OpenMode mode) { #warning implement } bool File::close() { #warning implement } int File::handle() { #warning implement } bool File::exists() { #warning implement } bool File::isLink() { #warning implement } // only on UNIX bool File::isFile() { #warning implement } bool File::isDirectory() { std::string tmpDirName = this->_name; struct stat status; // checking for the termination of the string given. If there is a "/" at the end cut it away if (directoryName[directoryName.size()-1] == '/' || directoryName[directoryName.size()-1] == '\\') { tmpDirName.erase(tmpDirName.size()-1); } if(!stat(tmpDirName.c_str(), &status)) { if (status.st_mode & (S_IFDIR #ifndef __WIN32__ | S_IFLNK #endif )) { return true; } else return false; } else return false; } bool File::isReadeable() { #warning implement } bool File::isWriteable() { #warning implement } bool File::isExecutable() { #warning implement } bool File::copy(const File& destination) { #warning implement } bool File::rename(const File& destination) { #warning implement } bool File::touch() { #warning implement } bool File::remove() { #warning implement } void File::relToAbs(std::string& fileName) { #warning implement } void File::absToRel(std::string& fileName) { #warning implement } std::string File::_cwd = ""; /** * @returns the Current Woring Directory */ const std::string& File::cwd() { if (File::_cwd.empty()) { char cwd[1024]; char* errorCode = getcwd(cwd, 1024); if (errorCode == 0) return File::_cwd; File::_cwd = cwd; } return File::_cwd; } #include "file.h"