Files
kaizen/test/test_pickfolder_cpp.cpp
SimoZ64 6e9eb898f5 Squashed 'external/nfd/' content from commit a1a40106
git-subtree-dir: external/nfd
git-subtree-split: a1a401062819beb8c3da84518ab1fe7de88632db
2025-05-04 00:37:23 +02:00

28 lines
687 B
C++

#include "nfd.hpp"
#include <iostream>
/* this test should compile on all supported platforms */
/* this demonstrates the thin C++ wrapper */
int main() {
// initialize NFD
NFD::Guard nfdGuard;
// auto-freeing memory
NFD::UniquePath outPath;
// show the dialog
nfdresult_t result = NFD::PickFolder(outPath);
if (result == NFD_OKAY) {
std::cout << "Success!" << std::endl << outPath.get() << std::endl;
} else if (result == NFD_CANCEL) {
std::cout << "User pressed cancel." << std::endl;
} else {
std::cout << "Error: " << NFD::GetError() << std::endl;
}
// NFD::Guard will automatically quit NFD.
return 0;
}