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

Function IGFD_GetFilePathName

ImGuiFileDialog.cpp:5027–5047  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5025}
5026
5027IGFD_C_API char* IGFD_GetFilePathName(ImGuiFileDialog* vContextPtr, IGFD_ResultMode vMode) {
5028 char* res = nullptr;
5029
5030 if (vContextPtr != nullptr) {
5031 auto s = vContextPtr->GetFilePathName(vMode);
5032 if (!s.empty()) {
5033 size_t siz = s.size() + 1U;
5034 res = (char*)malloc(siz);
5035 if (res) {
5036#ifndef _MSC_VER
5037 strncpy(res, s.c_str(), siz);
5038#else // _MSC_VER
5039 strncpy_s(res, siz, s.c_str(), siz);
5040#endif // _MSC_VER
5041 res[siz - 1U] = '\0';
5042 }
5043 }
5044 }
5045
5046 return res;
5047}
5048
5049IGFD_C_API char* IGFD_GetCurrentFileName(ImGuiFileDialog* vContextPtr, IGFD_ResultMode vMode) {
5050 char* res = nullptr;

Callers

nothing calls this directly

Calls 3

GetFilePathNameMethod · 0.80
emptyMethod · 0.80
sizeMethod · 0.80

Tested by

no test coverage detected