1#ifndef YAZE_UTIL_FILE_UTIL_H_
2#define YAZE_UTIL_FILE_UTIL_H_
30 std::function<
void(
const std::string&)> callback);
43 const std::string& default_name =
"",
44 const std::string& default_extension =
"");
50 const std::string& default_name =
"",
51 const std::string& default_extension =
"");
53 const std::string& default_name =
"",
54 const std::string& default_extension =
"");
58 const std::string& folder_path);
60 const std::string& folder_path);
91std::string
GetFileName(
const std::string& filename);
93void SaveFile(
const std::string& filename,
const std::string& data);
103std::string
LoadFile(
const std::string& filename);
static void ShowOpenFileDialogAsync(const FileDialogOptions &options, std::function< void(const std::string &)> callback)
static std::string ShowSaveFileDialogBespoke(const std::string &default_name="", const std::string &default_extension="")
static std::string ShowOpenFileDialogBespoke()
static std::string ShowSaveFileDialogNFD(const std::string &default_name="", const std::string &default_extension="")
static std::string ShowOpenFolderDialogNFD()
static std::string ShowSaveFileDialog(const std::string &default_name="", const std::string &default_extension="")
ShowSaveFileDialog opens a save file dialog and returns the selected filepath. Uses global feature fl...
static std::string ShowOpenFileDialog()
ShowOpenFileDialog opens a file dialog and returns the selected filepath. Uses global feature flag to...
static std::string ShowOpenFolderDialog()
ShowOpenFolderDialog opens a file dialog and returns the selected folder path. Uses global feature fl...
static std::vector< std::string > GetFilesInFolder(const std::string &folder_path)
static std::vector< std::string > GetSubdirectoriesInFolder(const std::string &folder_path)
static std::string ShowOpenFolderDialogBespoke()
static std::string ShowOpenFileDialogNFD()
void SaveFile(const std::string &filename, const std::string &contents)
std::string GetFileName(const std::string &filename)
Gets the filename from a full path.
std::string GetResourcePath(const std::string &resource_path)
std::string LoadFileFromConfigDir(const std::string &filename)
Loads a file from the user's config directory.
FileDialogOptions MakeRomFileDialogOptions(bool include_all_files)
std::string GetFileExtension(const std::string &filename)
Gets the file extension from a filename.
std::string GetBundleResourcePath()
GetBundleResourcePath returns the path to the bundle resource directory. Specific to MacOS.
std::string LoadFile(const std::string &filename)
Loads the entire contents of a file into a string.
std::vector< FileDialogFilter > filters