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

Method M_SortStrings

ImGuiFileDialog.cpp:1869–1879  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1867}
1868
1869bool IGFD::FileManager::M_SortStrings(const FileDialogInternal& vFileDialogInternal, const bool vInsensitiveCase, const bool vDescendingOrder, const std::string& vA, const std::string& vB) {
1870 if (vFileDialogInternal.getDialogConfig().flags & ImGuiFileDialogFlags_NaturalSorting) {
1871 return IGFD::Utils::NaturalCompare(vA, vB, vInsensitiveCase, vDescendingOrder);
1872 } else if (vInsensitiveCase) {
1873 const auto ret = stricmp(vA.c_str(), vB.c_str());
1874 return vDescendingOrder ? (ret > 0) : (ret < 0);
1875 } else {
1876 const auto ret = strcmp(vA.c_str(), vB.c_str());
1877 return vDescendingOrder ? (ret > 0) : (ret < 0);
1878 }
1879}
1880
1881void IGFD::FileManager::m_SortFields(const FileDialogInternal& vFileDialogInternal, std::vector<std::shared_ptr<FileInfos> >& vFileInfosList, std::vector<std::shared_ptr<FileInfos> >& vFileInfosFilteredList) {
1882 if (sortingField != SortingFieldEnum::FIELD_NONE) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected