00001 00002 /* 00003 This file is part of Highlight. 00004 00005 Highlight is free software: you can redistribute it and/or modify 00006 it under the terms of the GNU General Public License as published by 00007 the Free Software Foundation, either version 3 of the License, or 00008 (at your option) any later version. 00009 00010 Highlight is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 GNU General Public License for more details. 00014 00015 You should have received a copy of the GNU General Public License 00016 along with Highlight. If not, see <http://www.gnu.org/licenses/>. 00017 */ 00018 00019 #ifndef PLATFORM_FS__H__INCLUDED 00020 #define PLATFORM_FS__H__INCLUDED 00021 00022 #include <string> 00023 #include <iostream> 00024 #include <vector> 00025 /* 00026 #ifdef USE_FN_MATCH 00027 #include <fnmatch.h> 00028 #endif 00029 */ 00030 00031 namespace Platform 00032 { 00033 extern const char pathSeparator; 00034 00035 std::string getAppPath(); 00036 00040 bool getDirectoryEntries ( std::vector<std::string> &fileList, 00041 std::string wildcard, 00042 bool recursiveSearch=false ); 00043 00044 void getFileNames ( const std::string &directory,const std::string &wildcard, 00045 std::vector<std::string> &fileName ); 00046 00047 int wildcmp ( const char *wild, const char *data ); 00048 00049 /* 00050 #ifdef USE_FN_MATCH 00051 struct FnMatcher 00052 { 00053 FnMatcher(const char* pattern, int flags) 00054 : pattern_(pattern) 00055 , flags_(flags) 00056 {} 00057 bool operator()(const std::string& e) const { 00058 return ! ::fnmatch(pattern_, e.c_str(), flags_); 00059 } 00060 private: 00061 const char* pattern_; 00062 int flags_; 00063 }; 00064 #endif 00065 */ 00066 00067 } 00068 #endif