iZo

iZo is a small C++17 static library for native file-system dialogs on Windows and Linux.

Features

  • Open file, including multi-select and file filters
  • Save file
  • Pick folder
  • Open a path with its default application
  • Reveal a path in Explorer or the desktop file manager
  • Explicit selected, cancelled, and error result states

Windows uses the native Explorer IFileDialog API. Linux discovers zenity or kdialog at runtime; at least one must be installed for dialogs. Path opening uses xdg-open. Revealing uses the FreeDesktop file-manager D-Bus interface when available and otherwise opens the parent folder.

Build

cmake -S . -B build -DIZO_BUILD_EXAMPLE=ON
cmake --build build

To consume an installed copy:

find_package(iZo CONFIG REQUIRED)
target_link_libraries(your_target PRIVATE iZo::izo)

Usage

#include <izo/dialogs.hpp>

izo::dialog_options options;
options.title = "Choose an image";
options.filters = {{"Images", {"*.png", "*.jpg"}}};

auto result = izo::open_file(options);
if (result) {
    auto selected_path = result.paths.front();
} else if (result.status == izo::dialog_status::error) {
    // result.error_message contains the platform failure.
}
Description
OS IO Interface.
Readme MIT 166 KiB
Languages
C++ 97.5%
CMake 2.5%