MCPcopy Create free account
hub / github.com/aiekick/ImGuiFileDialog / IGFD_GetCurrentFileName

Function IGFD_GetCurrentFileName

ImGuiFileDialog.cpp:5049–5069  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5047}
5048
5049IGFD_C_API char* IGFD_GetCurrentFileName(ImGuiFileDialog* vContextPtr, IGFD_ResultMode vMode) {
5050 char* res = nullptr;
5051
5052 if (vContextPtr != nullptr) {
5053 auto s = vContextPtr->GetCurrentFileName(vMode);
5054 if (!s.empty()) {
5055 size_t siz = s.size() + 1U;
5056 res = (char*)malloc(siz);
5057 if (res) {
5058#ifndef _MSC_VER
5059 strncpy(res, s.c_str(), siz);
5060#else // _MSC_VER
5061 strncpy_s(res, siz, s.c_str(), siz);
5062#endif // _MSC_VER
5063 res[siz - 1U] = '\0';
5064 }
5065 }
5066 }
5067
5068 return res;
5069}
5070
5071IGFD_C_API char* IGFD_GetCurrentPath(ImGuiFileDialog* vContextPtr) {
5072 char* res = nullptr;

Callers

nothing calls this directly

Calls 3

GetCurrentFileNameMethod · 0.80
emptyMethod · 0.80
sizeMethod · 0.80

Tested by

no test coverage detected