| 5047 | } |
| 5048 | |
| 5049 | IGFD_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 | |
| 5071 | IGFD_C_API char* IGFD_GetCurrentPath(ImGuiFileDialog* vContextPtr) { |
| 5072 | char* res = nullptr; |
nothing calls this directly
no test coverage detected