MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/SPlisHSPlasH / NFD_PickFolderU8

Function NFD_PickFolderU8

extern/nfd/nfd_win.cpp:904–924  ·  view source on GitHub ↗

select folder dialog */ It is the caller's responsibility to free `outPath` via NFD_FreePathU8() if this function returns * NFD_OKAY */

Source from the content-addressed store, hash-verified

902/* It is the caller's responsibility to free `outPath` via NFD_FreePathU8() if this function returns
903 * NFD_OKAY */
904nfdresult_t NFD_PickFolderU8(nfdu8char_t** outPath, const nfdu8char_t* defaultPath) {
905 // convert and normalize the default path, but only if it is not nullptr
906 FreeCheck_Guard<nfdnchar_t> defaultPathNGuard;
907 ConvertU8ToNative(defaultPath, defaultPathNGuard);
908 NormalizePathSeparator(defaultPathNGuard.data);
909
910 // call the native function
911 nfdnchar_t* outPathN;
912 nfdresult_t res = NFD_PickFolderN(&outPathN, defaultPathNGuard.data);
913
914 if (res != NFD_OKAY) {
915 return res;
916 }
917
918 // convert the outPath to UTF-8
919 res = CopyWCharToNFDChar(outPathN, *outPath);
920
921 // free the native out path, and return the result
922 NFD_FreePathN(outPathN);
923 return res;
924}
925
926/* Get the UTF-8 path at offset index */
927/* It is the caller's responsibility to free `outPath` via NFD_FreePathU8() if this function returns

Callers 1

PickFolderFunction · 0.85

Calls 5

ConvertU8ToNativeFunction · 0.85
NormalizePathSeparatorFunction · 0.85
CopyWCharToNFDCharFunction · 0.85
NFD_PickFolderNFunction · 0.70
NFD_FreePathNFunction · 0.70

Tested by

no test coverage detected