Files
swr-ini-tool/src/file_browser.h
Niklas Friesen 4095980023 Update source copyright headers to NiklasCFW.
Replace the project-owned 2026 copyright owner in src headers from Switchroot to NiklasCFW while leaving vendored third-party notices unchanged.
2026-04-23 17:02:38 +02:00

36 lines
734 B
C++

/*
SWR INI Tool - Switchroot INI Configuration Editor
Copyright (C) 2026 NiklasCFW
*/
#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);
};