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

Function IGFD_GetCurrentPath

ImGuiFileDialog.cpp:5071–5091  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5069}
5070
5071IGFD_C_API char* IGFD_GetCurrentPath(ImGuiFileDialog* vContextPtr) {
5072 char* res = nullptr;
5073
5074 if (vContextPtr != nullptr) {
5075 auto s = vContextPtr->GetCurrentPath();
5076 if (!s.empty()) {
5077 size_t siz = s.size() + 1U;
5078 res = (char*)malloc(siz);
5079 if (res) {
5080#ifndef _MSC_VER
5081 strncpy(res, s.c_str(), siz);
5082#else // _MSC_VER
5083 strncpy_s(res, siz, s.c_str(), siz);
5084#endif // _MSC_VER
5085 res[siz - 1U] = '\0';
5086 }
5087 }
5088 }
5089
5090 return res;
5091}
5092
5093IGFD_C_API char* IGFD_GetCurrentFilter(ImGuiFileDialog* vContextPtr) {
5094 char* res = nullptr;

Callers

nothing calls this directly

Calls 3

GetCurrentPathMethod · 0.80
emptyMethod · 0.80
sizeMethod · 0.80

Tested by

no test coverage detected