ColPack
|
00001 /************************************************************************************ 00002 Copyright (C) 2005-2008 Assefaw H. Gebremedhin, Arijit Tarafdar, Duc Nguyen, 00003 Alex Pothen 00004 00005 This file is part of ColPack. 00006 00007 ColPack is free software: you can redistribute it and/or modify 00008 it under the terms of the GNU Lesser General Public License as published 00009 by the Free Software Foundation, either version 3 of the License, or 00010 (at your option) any later version. 00011 00012 ColPack is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 GNU Lesser General Public License for more details. 00016 00017 You should have received a copy of the GNU Lesser General Public License 00018 along with ColPack. If not, see <http://www.gnu.org/licenses/>. 00019 ************************************************************************************/ 00020 00021 #ifndef FILE_H 00022 #define FILE_H 00023 00024 #include<string> 00025 00026 using namespace std; 00027 00028 //#undef _WIN32 00029 00030 //define system-dependent directory separator 00031 #ifdef _WIN32 //Windows 00032 #define DIR_SEPARATOR "\\" 00033 #else //*nix 00034 #define DIR_SEPARATOR "/" 00035 #endif 00036 00037 00038 namespace ColPack 00039 { 00046 class File 00047 { 00048 private: 00049 00050 string path; //including the last DIR_SEPARATOR 00051 string name; 00052 string fileExtension; //excluding the '.' 00053 00054 public: 00055 00056 File(); 00057 00058 File(string fileName); 00059 00060 void Parse(string newFileName); 00061 00062 string GetPath() const; 00063 00064 string GetName() const; 00065 00067 string GetFileExtension() const; 00068 00069 string GetFullName() const; 00070 00071 void SetPath(string newPath); 00072 00073 void SetName(string newName); 00074 00075 void SetFileExtension(string newFileExtension); 00076 00077 }; 00078 00080 bool isMatrixMarketFormat(string s_fileExtension); 00081 00083 bool isHarwellBoeingFormat(string s_fileExtension); 00084 00086 bool isMeTiSFormat(string s_fileExtension); 00087 } 00088 #endif