| 5134 | } |
| 5135 | |
| 5136 | IGFD_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 | |
| 5158 | IGFD_C_API char* IGFD_GetCurrentFilter(ImGuiFileDialog* vContextPtr) { |
| 5159 | char* res = nullptr; |
nothing calls this directly
no test coverage detected