Squashed 'deps/nfde/' content from commit 28ade5a5c

git-subtree-dir: deps/nfde
git-subtree-split: 28ade5a5cc5d17cea8fe4034572cac8fd54eb53f
This commit is contained in:
2022-05-25 20:36:50 -05:00
commit 004534c8e7
31 changed files with 4827 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
#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;
}