summaryrefslogtreecommitdiff
path: root/Source/Core/Common/FileSearch.h
diff options
context:
space:
mode:
authorcomex <comexk@gmail.com>2014-11-15 15:46:40 -0500
committercomex <comexk@gmail.com>2015-05-28 19:14:42 -0400
commita225426510fc25316b3868e8764893dff284e77e (patch)
tree675c90e5057f2bbd5d2758d560845531e4dff303 /Source/Core/Common/FileSearch.h
parent6ff3fcee597663066c966a54ee51aab7fa166cd9 (diff)
Rewrite FileSearch and improve ScanDirectoryTree.
- FileSearch is now just one function, and it converts the original glob into a regex on all platforms rather than relying on native Windows pattern matching on there and a complete hack elsewhere. It now supports recursion out of the box rather than manually expanding into a full list of directories in multiple call sites. - This adds a GCC >= 4.9 dependency due to older versions having outright broken <regex>. MSVC is fine with it. - ScanDirectoryTree returns the parent entry rather than filling parts of it in via reference. The count is now stored in the entry like it was for subdirectories. - .glsl file search is now done with DoFileSearch. - IOCTLV_READ_DIR now uses ScanDirectoryTree directly and sorts the results after replacements for better determinism.
Diffstat (limited to 'Source/Core/Common/FileSearch.h')
-rw-r--r--Source/Core/Common/FileSearch.h17
1 files changed, 2 insertions, 15 deletions
diff --git a/Source/Core/Common/FileSearch.h b/Source/Core/Common/FileSearch.h
index 9820f1db05..cb15f84799 100644
--- a/Source/Core/Common/FileSearch.h
+++ b/Source/Core/Common/FileSearch.h
@@ -7,18 +7,5 @@
#include <string>
#include <vector>
-class CFileSearch
-{
-public:
- typedef std::vector<std::string>XStringVector;
-
- CFileSearch(const XStringVector& _rSearchStrings, const XStringVector& _rDirectories);
- const XStringVector& GetFileNames() const;
-
-private:
-
- void FindFiles(const std::string& _searchString, const std::string& _strPath);
-
- XStringVector m_FileNames;
-};
-
+std::vector<std::string> DoFileSearch(const std::vector<std::string>& globs, const std::vector<std::string>& directories, bool recursive = false);
+std::vector<std::string> FindSubdirectories(const std::vector<std::string>& directories, bool recursive);