Defined in:Returns the name of the file that is currently selected.
String<kMaxFileNameLength> GetFileName(int32 index = 0) const;
||The index of the selected file. If the |
GetFileNamefunction returns the relative path of a file that is currently selected in a file picker. The base directory for the relative path is the directory that was initially specified when the file picker was created. In the case that the
kFilePickerSubdirectorywas specified, the base directory is the enclosing directory of the initially specified directory.
indexparameter specifies the index of the selected file for which the name is returned. If the
kFilePickerMultipleSelectionflag was not specified, then
indexshould be omitted. Otherwise,
indexmay be in the range 0 to n − 1, where n is the number of files returned by the
If no file is selected, the value of the
indexparameter is out of range, or the requested file name corresponds to a directory, then the return value is the empty string.