Nameless Engine
Loading...
Searching...
No Matches
FileDialog.h
1#pragma once
2
3// Standard.
4#include <filesystem>
5#include <vector>
6#include <string>
7#include <optional>
8
9namespace ne {
11 class FileDialog {
12 public:
37 static std::vector<std::filesystem::path> openFile(
38 const std::string& sTitle,
39 const std::vector<std::pair<std::string, std::string>>& vFileTypeFilters = {{"All Files", {"*"}}},
40 const std::filesystem::path& directory = std::filesystem::current_path(),
41 bool bAllowSelectingMultipleFiles = false);
42
63 static std::optional<std::filesystem::path> saveFile(
64 const std::string& sTitle,
65 const std::pair<std::string, std::string>& fileType = {"All Files", {"*"}},
66 const std::filesystem::path& directory = std::filesystem::current_path());
67
76 static std::optional<std::filesystem::path> selectDirectory(
77 const std::string& sTitle,
78 const std::filesystem::path& directory = std::filesystem::current_path());
79 };
80} // namespace ne
Definition: FileDialog.h:11
static std::optional< std::filesystem::path > saveFile(const std::string &sTitle, const std::pair< std::string, std::string > &fileType={"All Files", {"*"}}, const std::filesystem::path &directory=std::filesystem::current_path())
Definition: FileDialog.cpp:43
static std::vector< std::filesystem::path > openFile(const std::string &sTitle, const std::vector< std::pair< std::string, std::string > > &vFileTypeFilters={{"All Files", {"*"}}}, const std::filesystem::path &directory=std::filesystem::current_path(), bool bAllowSelectingMultipleFiles=false)
Definition: FileDialog.cpp:16
static std::optional< std::filesystem::path > selectDirectory(const std::string &sTitle, const std::filesystem::path &directory=std::filesystem::current_path())
Definition: FileDialog.cpp:77