From 7b481b794d2747ba712def33da5d8a620e937a48 Mon Sep 17 00:00:00 2001 From: Jason Ly Date: Sat, 13 Dec 2025 18:45:32 -0500 Subject: [PATCH] windows version --- joomer-ftxui-file-browser.cpp | 9 +++-- joomer-ftxui-file-browser.vcxproj | 66 +++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+), 3 deletions(-) create mode 100644 joomer-ftxui-file-browser.vcxproj diff --git a/joomer-ftxui-file-browser.cpp b/joomer-ftxui-file-browser.cpp index 1a9f4ed..c22d1cd 100644 --- a/joomer-ftxui-file-browser.cpp +++ b/joomer-ftxui-file-browser.cpp @@ -16,12 +16,14 @@ void ReloadDirectory(ftxui::ScreenInteractive& screen, const fs::path& new_path, test = "ReloadDirectory"; namespace fs = std::filesystem; - std::string directory_path = new_path; // Replace with your directory path + //std::string directory_path = new_path.string; // Replace with your directory path // linux + std::string directory_path = new_path.string(); // Replace with your directory path //windows // Check if the path is a valid directory if (!fs::exists(new_path) || !fs::is_directory(new_path)) { // Handle error case (optional: display a warning in the TUI) cerr << "Error: Not a directory or path does not exist." << endl; - test = "path not a directory: " + string(new_path.c_str()); + //test = "path not a directory: " + string(new_path.c_str()); //linux + test = "path not a directory: " + new_path.string(); //windows return; } @@ -30,7 +32,8 @@ void ReloadDirectory(ftxui::ScreenInteractive& screen, const fs::path& new_path, test = "list dir"; entries.clear(); for (const auto& entry : fs::directory_iterator(new_path)) { - test = "got in for loop, new path is " + string(new_path.c_str()); + //test = "got in for loop, new path is " + string(new_path.c_str()); // linux + test = "got in for loop, new path is " + new_path.string(); // windows if (fs::is_directory(entry.path()) || fs::is_regular_file(entry.path())) { i++; std::string name = entry.path().filename().string(); diff --git a/joomer-ftxui-file-browser.vcxproj b/joomer-ftxui-file-browser.vcxproj new file mode 100644 index 0000000..63ad741 --- /dev/null +++ b/joomer-ftxui-file-browser.vcxproj @@ -0,0 +1,66 @@ + + + + + Debug + x64 + + + Release + x64 + + + + 17.0 + {161A1C11-0965-0C89-738B-B0F41F004E31} + Win32Proj + joomerftxuifilebrowser + 10.0 + + + false + + + + Application + true + v143 + Unicode + + + + + + true + $(SolutionDir)bin\$(Configuration)\ + $(SolutionDir)obj\$(Configuration)\ + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + stdcpp20 + MultiThreadedDebugDLL + ..\FTXUI\include;%(AdditionalIncludeDirectories) + + + Console + true + %(AdditionalLibraryDirectories) + ftxui-component.lib;ftxui-dom.lib;ftxui-screen.lib;msvcprtd.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + + + echo Post-build event started & + echo Post-build event finished + + + + + + + + \ No newline at end of file