| 5135 | } |
| 5136 | |
| 5137 | IGFD_C_API bool IGFD_GetFileStyle(ImGuiFileDialog* vContextPtr, IGFD_FileStyleFlags vFlags, const char* vCriteria, ImVec4* vOutColor, char** vOutIconText, ImFont** vOutFont) { |
| 5138 | if (vContextPtr != nullptr) { |
| 5139 | std::string icon; |
| 5140 | bool res = vContextPtr->GetFileStyle(vFlags, vCriteria, vOutColor, &icon, vOutFont); |
| 5141 | if (!icon.empty() && vOutIconText) { |
| 5142 | size_t siz = icon.size() + 1U; |
| 5143 | *vOutIconText = (char*)malloc(siz); |
| 5144 | if (*vOutIconText) { |
| 5145 | #ifndef _MSC_VER |
| 5146 | strncpy(*vOutIconText, icon.c_str(), siz); |
| 5147 | #else // _MSC_VER |
| 5148 | strncpy_s(*vOutIconText, siz, icon.c_str(), siz); |
| 5149 | #endif // _MSC_VER |
| 5150 | (*vOutIconText)[siz - 1U] = '\0'; |
| 5151 | } |
| 5152 | } |
| 5153 | return res; |
| 5154 | } |
| 5155 | |
| 5156 | return false; |
| 5157 | } |
| 5158 | |
| 5159 | IGFD_C_API void IGFD_ClearFilesStyle(ImGuiFileDialog* vContextPtr) { |
| 5160 | if (vContextPtr != nullptr) { |
nothing calls this directly
no test coverage detected