Compare commits

...

2 Commits

2 changed files with 72 additions and 3 deletions

View File

@ -16,12 +16,14 @@ void ReloadDirectory(ftxui::ScreenInteractive& screen, const fs::path& new_path,
test = "ReloadDirectory"; test = "ReloadDirectory";
namespace fs = std::filesystem; 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 // Check if the path is a valid directory
if (!fs::exists(new_path) || !fs::is_directory(new_path)) { if (!fs::exists(new_path) || !fs::is_directory(new_path)) {
// Handle error case (optional: display a warning in the TUI) // Handle error case (optional: display a warning in the TUI)
cerr << "Error: Not a directory or path does not exist." << endl; 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; return;
} }
@ -30,7 +32,8 @@ void ReloadDirectory(ftxui::ScreenInteractive& screen, const fs::path& new_path,
test = "list dir"; test = "list dir";
entries.clear(); entries.clear();
for (const auto& entry : fs::directory_iterator(new_path)) { 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())) { if (fs::is_directory(entry.path()) || fs::is_regular_file(entry.path())) {
i++; i++;
std::string name = entry.path().filename().string(); std::string name = entry.path().filename().string();

View File

@ -0,0 +1,66 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="17.0">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>17.0</VCProjectVersion>
<ProjectGuid>{161A1C11-0965-0C89-738B-B0F41F004E31}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>joomerftxuifilebrowser</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<PropertyGroup>
<VcpkgEnableManifest>false</VcpkgEnableManifest>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings" />
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)'=='Debug' and '$(Platform)'=='x64'">
<LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)bin\$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)obj\$(Configuration)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug' and '$(Platform)'=='x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpp20</LanguageStandard>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<AdditionalIncludeDirectories>..\FTXUI\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>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)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup>
<PostBuildEvent>
<Command>echo Post-build event started &amp;
echo Post-build event finished</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="joomer-ftxui-file-browser-win.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets" />
</Project>