Files
swr-ini-tool/src/file_browser.h
Niklas080208 617265f004 Initial commit
2026-02-11 20:33:01 +01:00

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);
};