FileSystem.h

Go to the documentation of this file.
00001 #ifndef FILE_SYSTEM_H
00002 #define FILE_SYSTEM_H
00003 
00004 #include <string>
00005 #include <unistd.h>
00006 #include <sys/types.h>
00007 #include <sys/stat.h>
00008 
00009 
00010 //!@defgroup filesystem Filesystem Utils
00011 //!Functions to assist in working with the file system
00012 //!@li FileSystem::FileExists
00013 //!@li FileSystem::DirectoryExists
00014 //!@li FileSystem::CompareFileTimestamps
00015 
00016 
00017 //!@ingroup filesystem
00018 namespace FileSystem
00019 {
00020     //!@return true if the specified file exists, and false otherwise.
00021     bool FileExists(const std::string & path);
00022     
00023     //!@return true if the specified directory exists, and false otherwise.
00024     bool DirectoryExists(const std::string & path);
00025 
00026     //!Compares the last modification times of file1 and file2. Returns one of the following values:
00027     //!@li If file1 has been modified more recently than file2, returns a value greater than zero (> 0)
00028     //!@li If file2 has been modified more recently than file1, returns a value less than zero (< 0)
00029     //!@li If file1 and file2 were last modified at the same time, returns zero (0)
00030     //!
00031     //!@throw CS240Exception if either file1 or file2 does not exist
00032     int CompareFileTimestamps(const std::string & path1, const std::string & path2);
00033 }
00034 
00035 
00036 #endif

Generated on Wed Jul 7 16:30:27 2010 for CS240Utils by  doxygen 1.5.8