diff options
author | archshift <admin@archshift.com> | 2015-02-19 07:37:01 +0100 |
---|---|---|
committer | archshift <admin@archshift.com> | 2015-02-19 08:23:18 +0100 |
commit | 49f94b82b4a9431c0db7327038695790bafdfd31 (patch) | |
tree | 07254c1b634a8b883d1306583344680e83701f6c /src/common | |
parent | Remove redundant utf8 compilation unit that was leftover from Dolphin (diff) | |
download | yuzu-49f94b82b4a9431c0db7327038695790bafdfd31.tar yuzu-49f94b82b4a9431c0db7327038695790bafdfd31.tar.gz yuzu-49f94b82b4a9431c0db7327038695790bafdfd31.tar.bz2 yuzu-49f94b82b4a9431c0db7327038695790bafdfd31.tar.lz yuzu-49f94b82b4a9431c0db7327038695790bafdfd31.tar.xz yuzu-49f94b82b4a9431c0db7327038695790bafdfd31.tar.zst yuzu-49f94b82b4a9431c0db7327038695790bafdfd31.zip |
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/common/file_search.cpp | 103 | ||||
-rw-r--r-- | src/common/file_search.h | 23 |
3 files changed, 0 insertions, 128 deletions
diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index e12699c23..b05c35546 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -4,7 +4,6 @@ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/scm_rev.cpp.in" "${CMAKE_CURRENT_SOU set(SRCS break_points.cpp emu_window.cpp - file_search.cpp file_util.cpp hash.cpp key_map.cpp @@ -36,7 +35,6 @@ set(HEADERS debug_interface.h emu_window.h fifo_queue.h - file_search.h file_util.h hash.h key_map.h diff --git a/src/common/file_search.cpp b/src/common/file_search.cpp deleted file mode 100644 index b3a0a84fb..000000000 --- a/src/common/file_search.cpp +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright 2013 Dolphin Emulator Project / 2014 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. - - -#include "common/common.h" - -#ifndef _WIN32 -#include <dirent.h> -#else -#include <windows.h> -#endif - -#include <algorithm> - -#include "common/file_search.h" -#include "common/string_util.h" - - -CFileSearch::CFileSearch(const CFileSearch::XStringVector& _rSearchStrings, const CFileSearch::XStringVector& _rDirectories) -{ - // Reverse the loop order for speed? - for (size_t j = 0; j < _rSearchStrings.size(); j++) - { - for (size_t i = 0; i < _rDirectories.size(); i++) - { - FindFiles(_rSearchStrings[j], _rDirectories[i]); - } - } -} - - -void CFileSearch::FindFiles(const std::string& _searchString, const std::string& _strPath) -{ - std::string GCMSearchPath; - Common::BuildCompleteFilename(GCMSearchPath, _strPath, _searchString); -#ifdef _WIN32 - WIN32_FIND_DATA findData; - HANDLE FindFirst = FindFirstFile(Common::UTF8ToTStr(GCMSearchPath).c_str(), &findData); - - if (FindFirst != INVALID_HANDLE_VALUE) - { - bool bkeepLooping = true; - - while (bkeepLooping) - { - if (findData.cFileName[0] != '.') - { - std::string strFilename; - Common::BuildCompleteFilename(strFilename, _strPath, Common::TStrToUTF8(findData.cFileName)); - m_FileNames.push_back(strFilename); - } - - bkeepLooping = FindNextFile(FindFirst, &findData) ? true : false; - } - } - FindClose(FindFirst); - - -#else - // TODO: super lame/broken - - auto end_match(_searchString); - - // assuming we have a "*.blah"-like pattern - if (!end_match.empty() && end_match[0] == '*') - end_match.erase(0, 1); - - // ugly - if (end_match == ".*") - end_match.clear(); - - DIR* dir = opendir(_strPath.c_str()); - - if (!dir) - return; - - while (auto const dp = readdir(dir)) - { - std::string found(dp->d_name); - - if ((found != ".") && (found != "..") - && (found.size() >= end_match.size()) - && std::equal(end_match.rbegin(), end_match.rend(), found.rbegin())) - { - std::string full_name; - if (_strPath.c_str()[_strPath.size()-1] == DIR_SEP_CHR) - full_name = _strPath + found; - else - full_name = _strPath + DIR_SEP + found; - - m_FileNames.push_back(full_name); - } - } - - closedir(dir); -#endif -} - -const CFileSearch::XStringVector& CFileSearch::GetFileNames() const -{ - return m_FileNames; -} diff --git a/src/common/file_search.h b/src/common/file_search.h deleted file mode 100644 index 55ca02638..000000000 --- a/src/common/file_search.h +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2013 Dolphin Emulator Project / 2014 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. - -#pragma once - -#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; -}; |