| 5069 | } |
| 5070 | |
| 5071 | IGFD_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 | |
| 5093 | IGFD_C_API char* IGFD_GetCurrentFilter(ImGuiFileDialog* vContextPtr) { |
| 5094 | char* res = nullptr; |
nothing calls this directly
no test coverage detected