Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages

File.h (Maintainer: Marc Sturm)

Go to the documentation of this file.
00001 // -*- Mode: C++; tab-width: 2; -*-
00002 // vi: set ts=2:
00003 //
00004 // --------------------------------------------------------------------------
00005 //                   OpenMS Mass Spectrometry Framework 
00006 // --------------------------------------------------------------------------
00007 //  Copyright (C) 2003-2008 -- Oliver Kohlbacher, Knut Reinert
00008 //
00009 //  This library is free software; you can redistribute it and/or
00010 //  modify it under the terms of the GNU Lesser General Public
00011 //  License as published by the Free Software Foundation; either
00012 //  version 2.1 of the License, or (at your option) any later version.
00013 //
00014 //  This library is distributed in the hope that it will be useful,
00015 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00017 //  Lesser General Public License for more details.
00018 //
00019 //  You should have received a copy of the GNU Lesser General Public
00020 //  License along with this library; if not, write to the Free Software
00021 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00022 //
00023 // --------------------------------------------------------------------------
00024 // $Maintainer: Marc Sturm $
00025 // --------------------------------------------------------------------------
00026 
00027 
00028 #ifndef OPENMS_SYSTEM_FILE_H
00029 #define OPENMS_SYSTEM_FILE_H
00030 
00031 #include <vector>
00032 #include <OpenMS/CONCEPT/Types.h>
00033 #include <OpenMS/config.h>
00034 
00035 #ifdef OPENMS_WINDOWSPLATFORM  
00036   #undef   _WIN32_WINNT        // avoid warning
00037   #define  _WIN32_WINNT 0x0500
00038   #include <Windows.h>
00039 #endif
00040 
00041 namespace OpenMS
00042 {
00043   class String;
00044   
00050   class File
00051   {
00052     public:
00053       
00055       static bool exists(const String& file);
00056     
00058       static bool empty(const String& file);
00059     
00065       static bool remove(const String& file);
00066 
00068       static void absolutePath(String& file);
00069 
00071       static String basename(const String& file);
00072 
00074       static String path(const String& file);
00075       
00077       static bool readable(const String& file);
00078 
00080       static bool writable(const String& file);
00081 
00091       static String find(const String& filename, std::vector<String> directories = std::vector<String>());
00092       
00098       static bool fileList(const String& dir, const String& file_pattern, std::vector<String>& output);
00099 
00101       static String getUniqueName();
00102 
00109       static bool createSparseFile(const String& filename, const Offset64Int& filesize);
00110 
00117       #ifdef OPENMS_WINDOWSPLATFORM
00118       static bool extendSparseFile(const HANDLE& hFile, const Offset64Int& filesize);
00119       #else
00120       static bool extendSparseFile(const int& hFile, const Offset64Int& filesize);
00121       #endif
00122                 
00134       #ifdef OPENMS_WINDOWSPLATFORM
00135       static HANDLE getSwapFileHandle(const String& filename, const Offset64Int& filesize, const bool& create);
00136       #else
00137       static    int getSwapFileHandle(const String& filename, const Offset64Int& filesize, const bool& create);
00138       #endif
00139     
00143       #ifdef OPENMS_WINDOWSPLATFORM
00144       static void closeSwapFileHandle(const HANDLE & f_handle);
00145       #else
00146       static void closeSwapFileHandle(const int & f_handle);
00147       #endif
00148     
00149   };
00150 
00151 }
00152 
00153 #endif // OPENMS_SYSTEM_FILE_H

Generated Tue Apr 1 15:36:34 2008 -- using doxygen 1.5.4 OpenMS / TOPP 1.1