00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef PLATFORM_FS__H__INCLUDED
00013 #define PLATFORM_FS__H__INCLUDED
00014
00015 #include <string>
00016 #include <iostream>
00017 #include <vector>
00018
00019 #ifdef USE_FN_MATCH
00020 #include <fnmatch.h>
00021 #endif
00022
00023 namespace Platform
00024 {
00025 extern const char pathSeparator;
00026
00027
00028 std::string getAppPath();
00029
00033 bool getDirectoryEntries(std::vector<std::string> &fileList,
00034 std::string wildcard,
00035 bool recursiveSearch=false);
00036
00037 #ifdef USE_FN_MATCH
00038 struct FnMatcher
00039 {
00040 FnMatcher(const char* pattern, int flags)
00041 : pattern_(pattern)
00042 , flags_(flags)
00043 {}
00044 bool operator()(const std::string& e) const {
00045
00046 return ! ::fnmatch(pattern_, e.c_str(), flags_);
00047 }
00048 private:
00049 const char* pattern_;
00050 int flags_;
00051 };
00052 #endif
00053 }
00054 #endif