$search
00001 // HOG-Man - Hierarchical Optimization for Pose Graphs on Manifolds 00002 // Copyright (C) 2010 G. Grisetti, R. Kümmerle, C. Stachniss 00003 // 00004 // HOG-Man is free software: you can redistribute it and/or modify 00005 // it under the terms of the GNU Lesser General Public License as published 00006 // by the Free Software Foundation, either version 3 of the License, or 00007 // (at your option) any later version. 00008 // 00009 // HOG-Man is distributed in the hope that it will be useful, 00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 // GNU Lesser General Public License for more details. 00013 // 00014 // You should have received a copy of the GNU Lesser General Public License 00015 // along with this program. If not, see <http://www.gnu.org/licenses/>. 00016 00017 #ifndef FILESYS_TOOLS_H 00018 #define FILESYS_TOOLS_H 00019 00020 00022 // @{ 00023 00028 #include <string> 00029 #include <vector> 00030 00031 namespace AISNavigation { 00032 00037 std::string getFileExtension(const std::string& filename); 00038 00043 std::string getPureFilename(const std::string& filename); 00044 00049 std::string changeFileExtension(const std::string& filename, const std::string& newExt, bool stripDot = false); 00050 00055 std::string getBasename(const std::string& filename); 00056 00061 std::string getDirname(const std::string& filename); 00062 00066 bool fileExists(const char* filename); 00067 00071 bool isRegularFile(const char* filename); 00072 00076 bool isDirectory(const char* filename); 00077 00081 bool isSymbolicLink(const char* filename); 00082 00088 off_t getFileSize(const char* filename); 00089 00093 std::string getCurrentDateAsFilename(); 00094 00096 time_t getLastModificationDate(const char* filename); 00097 00099 time_t getLastAccessDate(const char* filename); 00100 00102 time_t getLastStatusChangeDate(const char* filename); 00103 00108 bool createDirectory(const char* dirName, bool pub = false); 00109 00114 std::vector<std::string> getDirectoryElements(const char* dir, bool onlyFiles = false); 00115 00119 std::vector<std::string> getFilesByPattern(const char* pattern); 00120 00121 } // end namespace 00122 // @} 00123 #endif