MCPcopy Create free account
hub / github.com/TheForceEngine/TheForceEngine / openFileDialog

Function openFileDialog

TheForceEngine/TFE_Ui/ui.cpp:118–127  ·  view source on GitHub ↗

//////////////////////////////////////////////////////////////////////////////////////////////////// General TFE tries to keep paths consistently using forward slashes for readability, consistency and generally they work equally well on Linux, Mac and Windows. //////////////////////////////////////////////////////////////////////////////////////////////////// However* some specific APIs (usually o

Source from the content-addressed store, hash-verified

116// and restrict the ugliness to as small an area as possible.
117/////////////////////////////////////////////////////////////////////////////////////////////////////////
118FileResult openFileDialog(const char* title, const char* initPath, std::vector<std::string> const &filters/* = { "All Files", "*" }*/, bool multiSelect/* = false*/)
119{
120 char initPathOS[TFE_MAX_PATH] = "";
121 if (initPath)
122 {
123 FileUtil::convertToOSPath(initPath, initPathOS);
124 }
125
126 return pfd::open_file(title, initPathOS, filters, multiSelect ? pfd::opt::multiselect : pfd::opt::none).result();
127}
128
129FileResult directorySelectDialog(const char* title, const char* initPath, bool forceInitPath/* = false*/)
130{

Callers 5

menuFunction · 0.85
resources_uiFunction · 0.85
testOptionsFunction · 0.85
configGameFunction · 0.85

Calls 3

open_fileClass · 0.85
convertToOSPathFunction · 0.50
resultMethod · 0.45

Tested by 1

testOptionsFunction · 0.68