PIRL  PIRL++

Files.hh

Go to the documentation of this file.
00001 /*  Files
00002 
00003 PIRL CVS ID: Files.hh,v 1.7 2007/08/05 01:56:33 castalia Exp
00004 
00005 Copyright (C) 2006-2007 Arizona Board of Regents on behalf of the
00006 Planetary Image Research Laboratory, Lunar and Planetary Laboratory at
00007 the University of Arizona.
00008 
00009 This program is free software; you can redistribute it and/or modify it
00010 under the terms of the GNU General Public License, version 2, as
00011 published by the Free Software Foundation.
00012 
00013 This program is distributed in the hope that it will be useful, but
00014 WITHOUT ANY WARRANTY; without even the implied warranty of
00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00016 General Public License for more details.
00017 
00018 You should have received a copy of the GNU General Public License along
00019 with this program; if not, write to the Free Software Foundation, Inc.,
00020 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00021 */
00022 #ifndef _Files_
00023 #define _Files_
00024 
00025 #include    <string>
00026 
00027 namespace PIRL
00028 {
00029 /*==============================================================================
00030     Constants
00031 */
00033 extern const char
00034     *Files_ID;
00035     
00037 extern const char
00038     FILE_PATHNAME_DELIMITER;
00039 
00041 extern const char
00042     FILE_EXTENSION_DELIMITER;
00043 
00044 /*==============================================================================
00045     Functions
00046 */
00052 bool file_exists (const std::string& pathname);
00053 
00062 bool file_is_readable (const std::string& pathname);
00063 
00072 bool file_is_writeable (const std::string& pathname);
00073 
00080 bool file_is_normal (const std::string& pathname);
00081 
00088 bool file_is_directory (const std::string& pathname);
00089 
00096 bool file_is_link (const std::string& pathname);
00097 
00105 off_t file_size (const std::string& pathname);
00106 
00114 bool file_is_absolute (const std::string& pathname);
00115 
00127 std::string& clean_pathname (std::string& pathname);
00128 
00143 std::string file_pathname (const std::string& filename);
00144 
00162 std::string file_pathname
00163     (const std::string& directory, const std::string& filename);
00164 
00174 std::string CWD ();
00175 
00188 std::string file_directory (const std::string& pathname);
00189 
00206 std::string file_directory_pathname (const std::string& pathname);
00207 
00217 std::string file_name (const std::string& pathname);
00218 
00230 std::string file_basename (const std::string& pathname);
00231 
00241 std::string file_extension (const std::string& pathname);
00242 
00247 std::string home_directory_pathname ();
00248 
00253 std::string username ();
00254 
00259 unsigned int UID ();
00260 
00265 unsigned int GID ();
00266 
00271 std::string hostname ();
00272 
00273 }   //  PIRL namespace
00274 #endif

Generated on Sat Aug 4 19:03:05 2007 for PIRL++ by  doxygen 1.4.7