| 5200 | } |
| 5201 | |
| 5202 | IGFD_C_API bool IGFD_GetFileStyle(ImGuiFileDialog* vContextPtr, IGFD_FileStyleFlags vFlags, const char* vCriteria, ImVec4* vOutColor, char** vOutIconText, ImFont** vOutFont) { |
| 5203 | if (vContextPtr != nullptr) { |
| 5204 | std::string icon; |
| 5205 | bool res = vContextPtr->GetFileStyle(vFlags, vCriteria, vOutColor, &icon, vOutFont); |
| 5206 | if (!icon.empty() && vOutIconText) { |
| 5207 | size_t siz = icon.size() + 1U; |
| 5208 | *vOutIconText = (char*)malloc(siz); |
| 5209 | if (*vOutIconText) { |
| 5210 | #ifndef _MSC_VER |
| 5211 | strncpy(*vOutIconText, icon.c_str(), siz); |
| 5212 | #else // _MSC_VER |
| 5213 | strncpy_s(*vOutIconText, siz, icon.c_str(), siz); |
| 5214 | #endif // _MSC_VER |
| 5215 | (*vOutIconText)[siz - 1U] = '\0'; |
| 5216 | } |
| 5217 | } |
| 5218 | return res; |
| 5219 | } |
| 5220 | |
| 5221 | return false; |
| 5222 | } |
| 5223 | |
| 5224 | IGFD_C_API void IGFD_ClearFilesStyle(ImGuiFileDialog* vContextPtr) { |
| 5225 | if (vContextPtr != nullptr) { |
nothing calls this directly
no test coverage detected