mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-23 21:39:52 +00:00
8727679353
Fix UWP build Fix booting homebrew. Qt buildfix
53 lines
1.2 KiB
C++
53 lines
1.2 KiB
C++
#pragma once
|
|
|
|
#include <condition_variable>
|
|
#include <mutex>
|
|
#include <string>
|
|
#include <cstring>
|
|
#include <thread>
|
|
#include <vector>
|
|
#include <cstdlib>
|
|
|
|
|
|
#include "Common/File/DirListing.h"
|
|
#include "Common/File/Path.h"
|
|
|
|
// Abstraction above path that lets you navigate easily.
|
|
// "/" is a special path that means the root of the file system. On Windows,
|
|
// listing this will yield drives.
|
|
class PathBrowser {
|
|
public:
|
|
PathBrowser() {}
|
|
PathBrowser(const Path &path) { SetPath(path); }
|
|
~PathBrowser();
|
|
|
|
void SetPath(const Path &path);
|
|
bool IsListingReady();
|
|
bool GetListing(std::vector<File::FileInfo> &fileInfo, const char *filter = nullptr, bool *cancel = nullptr);
|
|
|
|
bool CanNavigateUp();
|
|
void NavigateUp();
|
|
void Navigate(const std::string &subdir);
|
|
|
|
Path GetPath() const {
|
|
return path_;
|
|
}
|
|
std::string GetFriendlyPath() const;
|
|
|
|
private:
|
|
void HandlePath();
|
|
void ResetPending();
|
|
|
|
Path path_;
|
|
Path pendingPath_;
|
|
std::vector<File::FileInfo> pendingFiles_;
|
|
std::condition_variable pendingCond_;
|
|
std::mutex pendingLock_;
|
|
std::thread pendingThread_;
|
|
bool pendingActive_ = false;
|
|
bool pendingCancel_ = false;
|
|
bool pendingStop_ = false;
|
|
bool ready_ = false;
|
|
};
|
|
|