Initial commit
This commit is contained in:
35
src/file_browser.h
Normal file
35
src/file_browser.h
Normal file
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
SWR INI Tool - Switchroot INI Configuration Editor
|
||||
Copyright (C) 2026 Switchroot
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <borealis.hpp>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <functional>
|
||||
|
||||
using FileSelectedCallback = std::function<void(const std::string& path)>;
|
||||
|
||||
class FileBrowser : public brls::AppletFrame
|
||||
{
|
||||
public:
|
||||
FileBrowser(const std::string& startDir, FileSelectedCallback callback);
|
||||
|
||||
private:
|
||||
brls::List* list;
|
||||
FileSelectedCallback callback;
|
||||
std::string currentDir;
|
||||
|
||||
void navigate(const std::string& dir);
|
||||
void selectFile(const std::string& path);
|
||||
|
||||
struct DirEntry
|
||||
{
|
||||
std::string name;
|
||||
bool isDir;
|
||||
};
|
||||
|
||||
std::vector<DirEntry> listDirectory(const std::string& dir);
|
||||
};
|
||||
Reference in New Issue
Block a user