| 5025 | } |
| 5026 | |
| 5027 | IGFD_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 | |
| 5049 | IGFD_C_API char* IGFD_GetCurrentFileName(ImGuiFileDialog* vContextPtr, IGFD_ResultMode vMode) { |
| 5050 | char* res = nullptr; |
nothing calls this directly
no test coverage detected