36 lines
735 B
C++
36 lines
735 B
C++
/*
|
|
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);
|
|
};
|