MCPcopy Create free account
hub / github.com/BlitterStudio/amiberry / IGFD_GetCurrentPath

Function IGFD_GetCurrentPath

external/ImGuiFileDialog/ImGuiFileDialog.cpp:5136–5156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5134}
5135
5136IGFD_C_API char* IGFD_GetCurrentPath(ImGuiFileDialog* vContextPtr) {
5137 char* res = nullptr;
5138
5139 if (vContextPtr != nullptr) {
5140 auto s = vContextPtr->GetCurrentPath();
5141 if (!s.empty()) {
5142 size_t siz = s.size() + 1U;
5143 res = (char*)malloc(siz);
5144 if (res) {
5145#ifndef _MSC_VER
5146 strncpy(res, s.c_str(), siz);
5147#else // _MSC_VER
5148 strncpy_s(res, siz, s.c_str(), siz);
5149#endif // _MSC_VER
5150 res[siz - 1U] = '\0';
5151 }
5152 }
5153 }
5154
5155 return res;
5156}
5157
5158IGFD_C_API char* IGFD_GetCurrentFilter(ImGuiFileDialog* vContextPtr) {
5159 char* res = nullptr;

Callers

nothing calls this directly

Calls 4

GetCurrentPathMethod · 0.80
c_strMethod · 0.80
emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected