00001 00002 // 00003 // Copyright (C) 2000 00004 // Ralf Westram 00005 // Time-stamp: <Thu Nov/14/2002 09:38 MET Coder@ReallySoft.de> 00006 // 00007 // Permission to use, copy, modify, distribute and sell this software 00008 // and its documentation for any purpose is hereby granted without fee, 00009 // provided that the above copyright notice appear in all copies and 00010 // that both that copyright notice and this permission notice appear 00011 // in supporting documentation. Ralf Westram makes no 00012 // representations about the suitability of this software for any 00013 // purpose. It is provided "as is" without express or implied warranty. 00014 // 00015 // This code is part of my library. 00016 // You may find a more recent version at http://www.reallysoft.de/ 00017 // 00019 00020 #ifndef SYS_DEP_H 00021 #define SYS_DEP_H 00022 00023 #ifndef __STDIO_H__ 00024 #include <stdio.h> 00025 #endif 00026 #ifndef __STRING__ 00027 #include <string> 00028 #endif 00029 #ifndef CTIME 00030 #include <ctime> 00031 #endif 00032 00033 #ifndef DOS 00034 # ifndef LINUX 00035 # error Either LINUX or DOS has to be defined. 00036 # endif 00037 #endif 00038 00039 00040 00041 namespace rs { 00042 00044 namespace sys_dep { 00045 00047 bool is_a_TTY(int filehandle); 00049 bool is_a_TTY(FILE *f); 00050 00052 std::string tempname(); 00053 00057 void sleep(unsigned milliseconds); 00058 }; 00059 00061 namespace posix { 00062 00064 off_t getFileSize(const std::string& fname); 00065 00067 time_t getFileModTime(const std::string& fname); 00068 00070 void setFileModTime(const std::string& fname, time_t mtime); 00071 00073 bool fileExists(const std::string& fname); 00074 00076 bool dirExists(const std::string& dname); 00077 00079 std::string getcwd(); 00080 00086 void create_directory(const std::string& dirname, bool throw_if_exists = false); 00087 }; 00088 00089 }; // end of namespace rs 00090 00091 #else 00092 #error sys_dep.h included twice 00093 #endif // SYS_DEP_H
Contact me in case of errors or questions. This documentation is powered by . |
(C) 2000-2002 |