MCPcopy Create free account
hub / github.com/aiekick/ImGuiFileDialog / IGFD_GetCurrentFilter

Function IGFD_GetCurrentFilter

ImGuiFileDialog.cpp:5093–5113  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5091}
5092
5093IGFD_C_API char* IGFD_GetCurrentFilter(ImGuiFileDialog* vContextPtr) {
5094 char* res = nullptr;
5095
5096 if (vContextPtr != nullptr) {
5097 auto s = vContextPtr->GetCurrentFilter();
5098 if (!s.empty()) {
5099 size_t siz = s.size() + 1U;
5100 res = (char*)malloc(siz);
5101 if (res) {
5102#ifndef _MSC_VER
5103 strncpy(res, s.c_str(), siz);
5104#else // _MSC_VER
5105 strncpy_s(res, siz, s.c_str(), siz);
5106#endif // _MSC_VER
5107 res[siz - 1U] = '\0';
5108 }
5109 }
5110 }
5111
5112 return res;
5113}
5114
5115IGFD_C_API void* IGFD_GetUserDatas(ImGuiFileDialog* vContextPtr) {
5116 if (vContextPtr != nullptr) {

Callers

nothing calls this directly

Calls 3

GetCurrentFilterMethod · 0.80
emptyMethod · 0.80
sizeMethod · 0.80

Tested by

no test coverage detected