NFD relies on preview features of the Java platform:
- NFDrefers to one or more preview APIs:- MemorySegment,- ValueLayout.
Native File Dialog Extended
A small C library with that portably invokes native file open, folder select and file save dialogs. Write dialog code once and have it pop up native dialogs on all supported platforms. Avoid linking large dependencies like wxWidgets and Qt.
Features:
- Supports Windows, MacOS, and Linux
- Friendly names for filters (e.g. Java Source files (*.java;*.kt)instead of(*.java;*.kt)) on platforms that support it
- Automatically append file extension on platforms where users expect it
- Support for setting a default folder path
- Support for setting a default file name (e.g. Untitled.java)
- Consistent UTF-8 support on all platforms
- Native character set (UTF-16LE) support on Windows
- Initialization and de-initialization of platform library (e.g. COM (Windows) / GTK (Linux GTK) / D-Bus (Linux portal)) decoupled from dialog functions, so applications can choose when to initialize/de-initialize
- Multiple file selection support (for file open dialog)
- No third party dependencies
Basic Usages
import overrungl.util.value.Pair;
void main() {
    NFD.init();
    try (MemoryStack stack = MemoryStack.stackPush()) {
        String[] outPath = new String[1];
        var filterItem = NFDNFilterItem.create(stack,
            new Pair<>("Source code", "java"),
            new Pair<>("Image file", "png,jpg"));
        var result = NFD.openDialogN(outPath, filterItem, null);
        switch (result) {
            case ERROR -> System.err.println("Error: " + NFD.getError());
            case OKAY -> System.out.println("Success! " + outPath[0]);
            case CANCEL -> System.out.println("User pressed cancel.");
        }
    }
    NFD.quit();
}File Filter Syntax
Files can be filtered by file extension groups:var filterItem = NFDNFilterItem.create(allocator,
    new Pair<>("Source code", "java"),
    new Pair<>("Image file", "png,jpg"));
A file filter is a pair of strings comprising the friendly name and the specification (multiple file extensions are comma-separated).
A list of file filters can be passed as an argument when invoking the library.
A wildcard filter is always added to every dialog.
Note: On MacOS, the file dialogs do not have friendly names and there is no way to switch between filters, so the filter specifications are combined (e.g. "java,kt,png,jpg"). The filter specification is also never explicitly shown to the user. This is usual MacOS behaviour and users expect it.
Note 2: You must ensure that the specification string is non-empty and that every file extension has at least one character. Otherwise, bad things might ensue (i.e. undefined behaviour).
Note 3: On Linux, the file extension is appended (if missing) when the user presses down the "Save" button. The appended file extension will remain visible to the user, even if an overwrite prompt is shown and the user then presses "Cancel".
Note 4: On Windows, the default folder parameter is only used if there is no recently used folder available. Otherwise, the default folder will be the folder that was last used. Internally, the Windows implementation calls IFileDialog::SetDefaultFolder(IShellItem). This is usual Windows behaviour and users expect it.
Iterating Over PathSets
A file open dialog that supports multiple selection produces a PathSet, which is a thin abstraction over the platform-specific collection. There are two ways to iterate over a PathSet:Accessing by index
This method does array-like access on the PathSet, and is the easiest to use. However, on certain platforms (Linux, and possibly Windows), it takes O(N²) time in total to iterate the entire PathSet, because the underlying platform-specific implementation uses a linked list.Using an enumerator (experimental)
This method uses an enumerator object to iterate the paths in the PathSet. It is guaranteed to take O(N) time in total to iterate the entire PathSet.
 See NFDEnumerator.
 
This API is experimental, and subject to change.
- Since:
- 0.1.0
- Author:
- squid233
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final ValueLayoutPREVIEWThe type of the path-set size (longfor Windows and Mac OS X,intfor others).
- 
Method SummaryModifier and TypeMethodDescriptionstatic voidclear the errorstatic voidfreePathN(@NativeType("nfdnchar_t*") MemorySegmentPREVIEW filePath) free a file path that was returned by the dialogsstatic voidfreePathU8(@NativeType("nfdu8char_t*") MemorySegmentPREVIEW filePath) free a file path that was returnedstatic StringgetError()Get last error -- set whenNFDResultreturnsNFDResult.ERRORstatic NFDResultinit()initialize NFD - call this for every thread that might use NFD, before calling any other NFD functions on that threadstatic @NativeType("const char*") MemorySegmentPREVIEWGet last error -- set whenNFDResultreturnsNFDResult.ERRORstatic NFDResultnopenDialogMultipleN(@NativeType("const nfdpathset_t**") MemorySegmentPREVIEW outPaths, @NativeType("const nfdnfilteritem_t*") MemorySegmentPREVIEW filterList, int filterCount, @NativeType("const nfdnchar_t*") MemorySegmentPREVIEW defaultPath) multiple file open dialogstatic NFDResultnopenDialogMultipleU8(@NativeType("const nfdpathset_t**") MemorySegmentPREVIEW outPaths, @NativeType("const nfdu8filteritem_t*") MemorySegmentPREVIEW filterList, int filterCount, @NativeType("const nfdu8char_t*") MemorySegmentPREVIEW defaultPath) multiple file open dialogstatic NFDResultnopenDialogN(@NativeType("nfdnchar_t**") MemorySegmentPREVIEW outPath, @NativeType("const nfdnfilteritem_t*") MemorySegmentPREVIEW filterList, int filterCount, @NativeType("const nfdnchar_t*") MemorySegmentPREVIEW defaultPath) single file open dialogstatic NFDResultnopenDialogU8(@NativeType("nfdu8char_t**") MemorySegmentPREVIEW outPath, @NativeType("const nfdu8filteritem_t*") MemorySegmentPREVIEW filterList, int filterCount, @NativeType("const nfdu8char_t*") MemorySegmentPREVIEW defaultPath) single file open dialogstatic NFDResultnpathSetEnumNextN(@NativeType("nfdpathsetenum_t*") MemorySegmentPREVIEW enumerator, @NativeType("nfdnchar_t**") MemorySegmentPREVIEW outPath) Gets the next item from the path set enumerator.static NFDResultnpathSetEnumNextU8(@NativeType("nfdpathsetenum_t*") MemorySegmentPREVIEW enumerator, @NativeType("nfdu8char_t**") MemorySegmentPREVIEW outPath) Gets the next item from the path set enumerator.static NFDResultnpathSetGetCount(@NativeType("const nfdpathset_t*") MemorySegmentPREVIEW pathSet, @NativeType("nfdpathsetsize_t*") MemorySegmentPREVIEW count) Gets the number of entries stored in pathSetstatic NFDResultnpathSetGetPathN(@NativeType("const nfdpathset_t*") MemorySegmentPREVIEW pathSet, long index, @NativeType("nfdnchar_t**") MemorySegmentPREVIEW outPath) Gets the UTF-8 path at offset indexstatic NFDResultnpathSetGetPathU8(@NativeType("const nfdpathset_t*") MemorySegmentPREVIEW pathSet, long index, @NativeType("nfdu8char_t**") MemorySegmentPREVIEW outPath) Gets the UTF-8 path at offset indexstatic NFDResultnpickFolderN(@NativeType("nfdnchar_t**") MemorySegmentPREVIEW outPath, @NativeType("const nfdnchar_t*") MemorySegmentPREVIEW defaultPath) select folder dialogstatic NFDResultnpickFolderU8(@NativeType("nfdu8char_t**") MemorySegmentPREVIEW outPath, @NativeType("const nfdu8char_t*") MemorySegmentPREVIEW defaultPath) select folder dialogstatic NFDResultnsaveDialogN(@NativeType("nfdnchar_t**") MemorySegmentPREVIEW outPath, @NativeType("const nfdnfilteritem_t*") MemorySegmentPREVIEW filterList, int filterCount, @NativeType("const nfdnchar_t*") MemorySegmentPREVIEW defaultPath, @NativeType("const nfdnchar_t*") MemorySegmentPREVIEW defaultName) save dialogstatic NFDResultnsaveDialogU8(@NativeType("nfdu8char_t**") MemorySegmentPREVIEW outPath, @NativeType("const nfdu8filteritem_t*") MemorySegmentPREVIEW filterList, int filterCount, @NativeType("const nfdu8char_t*") MemorySegmentPREVIEW defaultPath, @NativeType("const nfdu8char_t*") MemorySegmentPREVIEW defaultName) save dialogstatic NFDResultopenDialogMultipleN(@NativeType("const nfdpathset_t**") MemorySegmentPREVIEW outPaths, NFDNFilterItem.Buffer filterList, String defaultPath) multiple file open dialogstatic NFDResultopenDialogMultipleU8(@NativeType("const nfdpathset_t**") MemorySegmentPREVIEW outPaths, NFDU8FilterItem.Buffer filterList, String defaultPath) multiple file open dialogstatic NFDResultopenDialogN(String[] outPath, NFDNFilterItem.Buffer filterList, String defaultPath) single file open dialogstatic NFDResultopenDialogU8(String[] outPath, NFDU8FilterItem.Buffer filterList, String defaultPath) single file open dialogstatic NFDResultpathSetEnumNextN(@NativeType("nfdpathsetenum_t*") MemorySegmentPREVIEW enumerator, String[] outPath) Gets the next item from the path set enumerator.static NFDResultpathSetEnumNextU8(@NativeType("nfdpathsetenum_t*") MemorySegmentPREVIEW enumerator, String[] outPath) Gets the next item from the path set enumerator.static voidpathSetFree(@NativeType("const nfdpathset_t*") MemorySegmentPREVIEW pathSet) Free the pathSetstatic voidpathSetFreeEnum(@NativeType("nfdpathsetenum_t*") MemorySegmentPREVIEW enumerator) Frees an enumerator of the path set.static voidpathSetFreePathN(@NativeType("const nfdnchar_t*") MemorySegmentPREVIEW filePath) Free the path gotten bypathSetGetPathN(java.lang.foreign.MemorySegment, long, java.lang.String[])PREVIEWstatic voidpathSetFreePathU8(MemorySegmentPREVIEW filePath) Free the path gotten bypathSetGetPathU8(java.lang.foreign.MemorySegment, long, java.lang.String[])PREVIEWstatic Tuple2.OfObjLong<NFDResult> pathSetGetCount(@NativeType("const nfdpathset_t*") MemorySegmentPREVIEW pathSet) Gets the number of entries stored in pathSetstatic NFDResultpathSetGetCount(@NativeType("const nfdpathset_t*") MemorySegmentPREVIEW pathSet, long[] count) Gets the number of entries stored in pathSetstatic NFDResultpathSetGetEnum(@NativeType("const nfdpathset_t*") MemorySegmentPREVIEW pathSet, @NativeType("nfdpathsetenum_t*") MemorySegmentPREVIEW outEnumerator) Gets an enumerator of the path set.static NFDResultpathSetGetPathN(@NativeType("const nfdpathset_t*") MemorySegmentPREVIEW pathSet, long index, String[] outPath) Gets the UTF-8 path at offset indexstatic NFDResultpathSetGetPathU8(@NativeType("const nfdpathset_t*") MemorySegmentPREVIEW pathSet, long index, String[] outPath) Gets the UTF-8 path at offset indexstatic NFDResultpickFolderN(String[] outPath, String defaultPath) select folder dialogstatic NFDResultpickFolderU8(String[] outPath, String defaultPath) select folder dialogstatic voidquit()call this to de-initialize NFD, ifinit()returnedNFDResult.OKAYstatic NFDResultsaveDialogN(String[] outPath, NFDNFilterItem.Buffer filterList, String defaultPath, String defaultName) save dialogstatic NFDResultsaveDialogU8(String[] outPath, NFDU8FilterItem.Buffer filterList, String defaultPath, String defaultName) save dialog
- 
Field Details- 
PATH_SET_SIZEThe type of the path-set size (longfor Windows and Mac OS X,intfor others).
 
- 
- 
Method Details- 
freePathNfree a file path that was returned by the dialogsNote: use NFD::pathSetFreePathto free path from path-set instead of this function- Parameters:
- filePath- the file path
 
- 
initinitialize NFD - call this for every thread that might use NFD, before calling any other NFD functions on that thread- Returns:
- the result
 
- 
quitpublic static void quit()call this to de-initialize NFD, ifinit()returnedNFDResult.OKAY
- 
nopenDialogNpublic static NFDResult nopenDialogN(@NativeType("nfdnchar_t**") MemorySegmentPREVIEW outPath, @NativeType("const nfdnfilteritem_t*") MemorySegmentPREVIEW filterList, int filterCount, @NativeType("const nfdnchar_t*") MemorySegmentPREVIEW defaultPath) single file open dialog- Parameters:
- outPath- It is the caller's responsibility to free- *outPathvia- freePathN(java.lang.foreign.MemorySegment)PREVIEW if this function returns- NFDResult.OKAY
- filterList- the filter list
- filterCount- If filterCount is zero, filterList is ignored (you can use NULL)
- defaultPath- If defaultPath is NULL, the operating system will decide
- Returns:
- the result
 
- 
openDialogNpublic static NFDResult openDialogN(String[] outPath, NFDNFilterItem.Buffer filterList, String defaultPath) single file open dialog- Parameters:
- outPath- the out path
- filterList- the filter list
- defaultPath- If defaultPath is NULL, the operating system will decide
- Returns:
- the result
- See Also:
 
- 
nopenDialogMultipleNpublic static NFDResult nopenDialogMultipleN(@NativeType("const nfdpathset_t**") MemorySegmentPREVIEW outPaths, @NativeType("const nfdnfilteritem_t*") MemorySegmentPREVIEW filterList, int filterCount, @NativeType("const nfdnchar_t*") MemorySegmentPREVIEW defaultPath) multiple file open dialog- Parameters:
- outPaths- It is the caller's responsibility to free- *outPathsvia- pathSetFree(java.lang.foreign.MemorySegment)PREVIEW if this function returns- NFDResult.OKAY
- filterList- the filter list
- filterCount- If filterCount is zero, filterList is ignored (you can use NULL)
- defaultPath- If defaultPath is NULL, the operating system will decide
- Returns:
- the result
 
- 
openDialogMultipleNpublic static NFDResult openDialogMultipleN(@NativeType("const nfdpathset_t**") MemorySegmentPREVIEW outPaths, NFDNFilterItem.Buffer filterList, String defaultPath) multiple file open dialog- Parameters:
- outPaths- It is the caller's responsibility to free- *outPathsvia- pathSetFree(java.lang.foreign.MemorySegment)PREVIEW if this function returns- NFDResult.OKAY
- filterList- the filter list
- defaultPath- If defaultPath is NULL, the operating system will decide
- Returns:
- the result
- See Also:
 
- 
nsaveDialogNpublic static NFDResult nsaveDialogN(@NativeType("nfdnchar_t**") MemorySegmentPREVIEW outPath, @NativeType("const nfdnfilteritem_t*") MemorySegmentPREVIEW filterList, int filterCount, @NativeType("const nfdnchar_t*") MemorySegmentPREVIEW defaultPath, @NativeType("const nfdnchar_t*") MemorySegmentPREVIEW defaultName) save dialog- Parameters:
- outPath- It is the caller's responsibility to free- *outPathvia- freePathN(java.lang.foreign.MemorySegment)PREVIEW if this function returns- NFDResult.OKAY
- filterList- the filter list
- filterCount- If filterCount is zero, filterList is ignored (you can use NULL)
- defaultPath- If defaultPath is NULL, the operating system will decide
- defaultName- the default name of the file
- Returns:
- the result
 
- 
saveDialogNpublic static NFDResult saveDialogN(String[] outPath, NFDNFilterItem.Buffer filterList, String defaultPath, String defaultName) save dialog- Parameters:
- outPath- the out path
- filterList- the filter list
- defaultPath- If defaultPath is NULL, the operating system will decide
- defaultName- the default name of the file
- Returns:
- the result
- See Also:
 
- 
npickFolderNpublic static NFDResult npickFolderN(@NativeType("nfdnchar_t**") MemorySegmentPREVIEW outPath, @NativeType("const nfdnchar_t*") MemorySegmentPREVIEW defaultPath) select folder dialog- Parameters:
- outPath- It is the caller's responsibility to free- *outPathvia- freePathN(java.lang.foreign.MemorySegment)PREVIEW if this function returns- NFDResult.OKAY
- defaultPath- If defaultPath is NULL, the operating system will decide
- Returns:
- the result
 
- 
pickFolderNselect folder dialog- Parameters:
- outPath- the out path
- defaultPath- If defaultPath is NULL, the operating system will decide
- Returns:
- the result
- See Also:
 
- 
ngetErrorGet last error -- set whenNFDResultreturnsNFDResult.ERRORThe memory is owned by NFD and should not be freed by user code. This is always ASCII printable characters, so it can be interpreted as UTF-8 without any conversion. - Returns:
- the last error that was set, or NULL if there is no error.
 
- 
getErrorGet last error -- set whenNFDResultreturnsNFDResult.ERROR- Returns:
- the last error that was set, or NULL if there is no error.
- See Also:
 
- 
clearErrorpublic static void clearError()clear the error
- 
npathSetGetCountpublic static NFDResult npathSetGetCount(@NativeType("const nfdpathset_t*") MemorySegmentPREVIEW pathSet, @NativeType("nfdpathsetsize_t*") MemorySegmentPREVIEW count) Gets the number of entries stored in pathSetnote that some paths might be invalid (NFD_ERROR will be returned by NFD_PathSet_GetPath), so we might not actually have this number of usable paths - Parameters:
- pathSet- the path-set
- count- the count
- Returns:
- the result
 
- 
pathSetGetCountpublic static NFDResult pathSetGetCount(@NativeType("const nfdpathset_t*") MemorySegmentPREVIEW pathSet, long[] count) Gets the number of entries stored in pathSet- Parameters:
- pathSet- the path-set
- count- the count
- Returns:
- the result
- See Also:
 
- 
pathSetGetCountpublic static Tuple2.OfObjLong<NFDResult> pathSetGetCount(@NativeType("const nfdpathset_t*") MemorySegmentPREVIEW pathSet) Gets the number of entries stored in pathSet- Parameters:
- pathSet- the path-set
- Returns:
- the result and the count
- See Also:
 
- 
npathSetGetPathNpublic static NFDResult npathSetGetPathN(@NativeType("const nfdpathset_t*") MemorySegmentPREVIEW pathSet, long index, @NativeType("nfdnchar_t**") MemorySegmentPREVIEW outPath) Gets the UTF-8 path at offset index- Parameters:
- pathSet- the path-set
- index- the index
- outPath- It is the caller's responsibility to free- *outPathvia- pathSetFreePathN(java.lang.foreign.MemorySegment)PREVIEW if this function returns- NFDResult.OKAY
- Returns:
- the result
 
- 
pathSetGetPathNpublic static NFDResult pathSetGetPathN(@NativeType("const nfdpathset_t*") MemorySegmentPREVIEW pathSet, long index, String[] outPath) Gets the UTF-8 path at offset index- Parameters:
- pathSet- the path-set
- index- the index
- outPath- the out path
- Returns:
- the result
- See Also:
 
- 
pathSetFreePathNFree the path gotten bypathSetGetPathN(java.lang.foreign.MemorySegment, long, java.lang.String[])PREVIEW- Parameters:
- filePath- the path
 
- 
pathSetGetEnumpublic static NFDResult pathSetGetEnum(@NativeType("const nfdpathset_t*") MemorySegmentPREVIEW pathSet, @NativeType("nfdpathsetenum_t*") MemorySegmentPREVIEW outEnumerator) Gets an enumerator of the path set.- Parameters:
- pathSet- the path set
- outEnumerator- It is the caller's responsibility to free- enumeratorvia- pathSetFreeEnum(java.lang.foreign.MemorySegment)PREVIEW if this function returns- NFDResult.OKAY, and it should be freed before freeing the path-set.
- Returns:
- the result
 
- 
pathSetFreeEnumpublic static void pathSetFreeEnum(@NativeType("nfdpathsetenum_t*") MemorySegmentPREVIEW enumerator) Frees an enumerator of the path set.- Parameters:
- enumerator- the enumerator
 
- 
npathSetEnumNextNpublic static NFDResult npathSetEnumNextN(@NativeType("nfdpathsetenum_t*") MemorySegmentPREVIEW enumerator, @NativeType("nfdnchar_t**") MemorySegmentPREVIEW outPath) Gets the next item from the path set enumerator.If there are no more items, then *outPaths will be set to NULL. - Parameters:
- enumerator- the enumerator
- outPath- It is the caller's responsibility to free- *outPathvia- pathSetFreePathN(java.lang.foreign.MemorySegment)PREVIEW if this function returns- NFDResult.OKAYand- *outPathis not null
- Returns:
- the result
 
- 
pathSetEnumNextNpublic static NFDResult pathSetEnumNextN(@NativeType("nfdpathsetenum_t*") MemorySegmentPREVIEW enumerator, String[] outPath) Gets the next item from the path set enumerator.- Parameters:
- enumerator- the enumerator
- outPath- the out path
- Returns:
- the result
- See Also:
 
- 
pathSetFreeFree the pathSet- Parameters:
- pathSet- the pathSet
 
- 
freePathU8free a file path that was returned- Parameters:
- filePath- the file path
 
- 
nopenDialogU8public static NFDResult nopenDialogU8(@NativeType("nfdu8char_t**") MemorySegmentPREVIEW outPath, @NativeType("const nfdu8filteritem_t*") MemorySegmentPREVIEW filterList, int filterCount, @NativeType("const nfdu8char_t*") MemorySegmentPREVIEW defaultPath) single file open dialog- Parameters:
- outPath- It is the caller's responsibility to free- *outPathvia- freePathU8(java.lang.foreign.MemorySegment)PREVIEW if this function returns- NFDResult.OKAY
- filterList- the filter list
- filterCount- If filterCount is zero, filterList is ignored (you can use NULL)
- defaultPath- If defaultPath is NULL, the operating system will decide
- Returns:
- the result
 
- 
openDialogU8public static NFDResult openDialogU8(String[] outPath, NFDU8FilterItem.Buffer filterList, String defaultPath) single file open dialog- Parameters:
- outPath- the out path
- filterList- the filter list
- defaultPath- If defaultPath is NULL, the operating system will decide
- Returns:
- the result
- See Also:
 
- 
nopenDialogMultipleU8public static NFDResult nopenDialogMultipleU8(@NativeType("const nfdpathset_t**") MemorySegmentPREVIEW outPaths, @NativeType("const nfdu8filteritem_t*") MemorySegmentPREVIEW filterList, int filterCount, @NativeType("const nfdu8char_t*") MemorySegmentPREVIEW defaultPath) multiple file open dialog- Parameters:
- outPaths- It is the caller's responsibility to free- *outPathsvia- pathSetFree(java.lang.foreign.MemorySegment)PREVIEW if this function returns- NFDResult.OKAY
- filterList- the filter list
- filterCount- If filterCount is zero, filterList is ignored (you can use NULL)
- defaultPath- If defaultPath is NULL, the operating system will decide
- Returns:
- the result
 
- 
openDialogMultipleU8public static NFDResult openDialogMultipleU8(@NativeType("const nfdpathset_t**") MemorySegmentPREVIEW outPaths, NFDU8FilterItem.Buffer filterList, String defaultPath) multiple file open dialog- Parameters:
- outPaths- It is the caller's responsibility to free- *outPathsvia- pathSetFree(java.lang.foreign.MemorySegment)PREVIEW if this function returns- NFDResult.OKAY
- filterList- the filter list
- defaultPath- If defaultPath is NULL, the operating system will decide
- Returns:
- the result
- See Also:
 
- 
nsaveDialogU8public static NFDResult nsaveDialogU8(@NativeType("nfdu8char_t**") MemorySegmentPREVIEW outPath, @NativeType("const nfdu8filteritem_t*") MemorySegmentPREVIEW filterList, int filterCount, @NativeType("const nfdu8char_t*") MemorySegmentPREVIEW defaultPath, @NativeType("const nfdu8char_t*") MemorySegmentPREVIEW defaultName) save dialog- Parameters:
- outPath- It is the caller's responsibility to free- *outPathvia- freePathU8(java.lang.foreign.MemorySegment)PREVIEW if this function returns- NFDResult.OKAY
- filterList- the filter list
- filterCount- If filterCount is zero, filterList is ignored (you can use NULL)
- defaultPath- If defaultPath is NULL, the operating system will decide
- defaultName- the default name of the file
- Returns:
- the result
 
- 
saveDialogU8public static NFDResult saveDialogU8(String[] outPath, NFDU8FilterItem.Buffer filterList, String defaultPath, String defaultName) save dialog- Parameters:
- outPath- the out path
- filterList- the filter list
- defaultPath- If defaultPath is NULL, the operating system will decide
- defaultName- the default name of the file
- Returns:
- the result
- See Also:
 
- 
npickFolderU8public static NFDResult npickFolderU8(@NativeType("nfdu8char_t**") MemorySegmentPREVIEW outPath, @NativeType("const nfdu8char_t*") MemorySegmentPREVIEW defaultPath) select folder dialog- Parameters:
- outPath- It is the caller's responsibility to free- *outPathvia- freePathU8(java.lang.foreign.MemorySegment)PREVIEW if this function returns- NFDResult.OKAY
- defaultPath- If defaultPath is NULL, the operating system will decide
- Returns:
- the result
 
- 
pickFolderU8select folder dialog- Parameters:
- outPath- the out path
- defaultPath- If defaultPath is NULL, the operating system will decide
- Returns:
- the result
- See Also:
 
- 
npathSetGetPathU8public static NFDResult npathSetGetPathU8(@NativeType("const nfdpathset_t*") MemorySegmentPREVIEW pathSet, long index, @NativeType("nfdu8char_t**") MemorySegmentPREVIEW outPath) Gets the UTF-8 path at offset index- Parameters:
- pathSet- the path-set
- index- the index
- outPath- It is the caller's responsibility to free- *outPathvia- pathSetFreePathU8(java.lang.foreign.MemorySegment)PREVIEW if this function returns- NFDResult.OKAY
- Returns:
- the result
 
- 
pathSetGetPathU8public static NFDResult pathSetGetPathU8(@NativeType("const nfdpathset_t*") MemorySegmentPREVIEW pathSet, long index, String[] outPath) Gets the UTF-8 path at offset index- Parameters:
- pathSet- the path-set
- index- the index
- outPath- the out path
- Returns:
- the result
- See Also:
 
- 
npathSetEnumNextU8public static NFDResult npathSetEnumNextU8(@NativeType("nfdpathsetenum_t*") MemorySegmentPREVIEW enumerator, @NativeType("nfdu8char_t**") MemorySegmentPREVIEW outPath) Gets the next item from the path set enumerator.If there are no more items, then *outPaths will be set to NULL. - Parameters:
- enumerator- the enumerator
- outPath- It is the caller's responsibility to free- *outPathvia- pathSetFreePathU8(java.lang.foreign.MemorySegment)PREVIEW if this function returns- NFDResult.OKAYand- *outPathis not null
- Returns:
- the result
 
- 
pathSetEnumNextU8public static NFDResult pathSetEnumNextU8(@NativeType("nfdpathsetenum_t*") MemorySegmentPREVIEW enumerator, String[] outPath) Gets the next item from the path set enumerator.- Parameters:
- enumerator- the enumerator
- outPath- the out path
- Returns:
- the result
- See Also:
 
- 
pathSetFreePathU8Free the path gotten bypathSetGetPathU8(java.lang.foreign.MemorySegment, long, java.lang.String[])PREVIEW- Parameters:
- filePath- the path
 
 
- 
NFDwhen preview features are enabled.