Skip to content

Commit dfea60c

Browse files
committed
-
1 parent 90a35b0 commit dfea60c

2 files changed

Lines changed: 27 additions & 20 deletions

File tree

ImGuiFileDialog.cpp

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@ namespace IGFD
588588
#endif // USE_STD_FILESYSTEM
589589
}
590590

591-
return bExists; // this is not a directory!
591+
return bExists; // this is not a directory!
592592
}
593593

594594
bool IGFD::Utils::IsDirectoryExist(const std::string& name)
@@ -629,7 +629,7 @@ namespace IGFD
629629
#endif // USE_STD_FILESYSTEM
630630
}
631631

632-
return bExists; // this is not a directory!
632+
return bExists; // this is not a directory!
633633
}
634634

635635
bool IGFD::Utils::CreateDirectoryIfNotExist(const std::string& name)
@@ -900,17 +900,15 @@ namespace IGFD
900900
//// FILTER MANAGER /////////////////////////////////////////////////////////////////
901901
/////////////////////////////////////////////////////////////////////////////////////
902902

903-
void IGFD::FilterManager::ParseFilters(const char* vFilters)
904-
{
903+
void IGFD::FilterManager::ParseFilters(const char* vFilters) {
905904
prParsedFilters.clear();
906905

907906
if (vFilters)
908907
puDLGFilters = vFilters; // file mode
909908
else
910909
puDLGFilters.clear(); // directory mode
911910

912-
if (!puDLGFilters.empty())
913-
{
911+
if (!puDLGFilters.empty()) {
914912
// ".*,.cpp,.h,.hpp" => simple filters
915913
// "Source files{.cpp,.h,.hpp},Image files{.png,.gif,.jpg,.jpeg},.md" => collection filters
916914
// "([.][0-9]{3}),.cpp,.h,.hpp" => simple filters with regex
@@ -920,22 +918,19 @@ namespace IGFD
920918

921919
size_t nan = std::string::npos;
922920
size_t p = 0, lp = 0;
923-
while ((p = puDLGFilters.find_first_of("{,", p)) != nan)
924-
{
921+
while ((p = puDLGFilters.find_first_of("{,", p)) != nan) {
925922
FilterInfos infos;
926923

927-
if (puDLGFilters[p] == '{') // {
924+
if (puDLGFilters[p] == '{') // {
928925
{
929926
infos.filter = puDLGFilters.substr(lp, p - lp);
930927
infos.filter_optimized = Utils::LowerCaseString(infos.filter);
931928
p++;
932929
lp = puDLGFilters.find('}', p);
933-
if (lp != nan)
934-
{
930+
if (lp != nan) {
935931
std::string fs = puDLGFilters.substr(p, lp - p);
936932
auto arr = IGFD::Utils::SplitStringToVector(fs, ',', false);
937-
for (auto a : arr)
938-
{
933+
for (auto a : arr) {
939934
infos.collectionfilters.emplace(a);
940935
infos.collectionfilters_optimized.emplace(Utils::LowerCaseString(a));
941936

@@ -948,8 +943,7 @@ namespace IGFD
948943
}
949944
}
950945
p = lp + 1;
951-
}
952-
else // ,
946+
} else // ,
953947
{
954948
infos.filter = puDLGFilters.substr(lp, p - lp);
955949
infos.filter_optimized = Utils::LowerCaseString(infos.filter);
@@ -964,8 +958,7 @@ namespace IGFD
964958
p++;
965959
}
966960

967-
if (!currentFilterFound && prSelectedFilter.filter == infos.filter)
968-
{
961+
if (!currentFilterFound && prSelectedFilter.filter == infos.filter) {
969962
currentFilterFound = true;
970963
prSelectedFilter = infos;
971964
}
@@ -976,8 +969,7 @@ namespace IGFD
976969
}
977970

978971
std::string token = puDLGFilters.substr(lp);
979-
if (!token.empty())
980-
{
972+
if (!token.empty()) {
981973
FilterInfos infos;
982974
infos.filter = std::move(token);
983975
prParsedFilters.emplace_back(infos);

ImGuiFileDialog.h

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
MIT License
33
4-
Copyright (c) 2018-2022 Stephane Cuillerdier (aka aiekick)
4+
Copyright (c) 2018-2023 Stephane Cuillerdier (aka aiekick)
55
66
Permission is hereby granted, free of charge, to any person obtaining a copy
77
of this software and associated documentation files (the "Software"), to deal
@@ -23,6 +23,21 @@ SOFTWARE.
2323
*/
2424

2525
/*
26+
_____ _____ _ ______ _ _ _____ _ _
27+
|_ _| / ____| (_) ____(_) | | __ \(_) | |
28+
| | _ __ ___ | | __ _ _ _| |__ _| | ___| | | |_ __ _| | ___ __ _
29+
| | | '_ ` _ \| | |_ | | | | | __| | | |/ _ \ | | | |/ _` | |/ _ \ / _` |
30+
_| |_| | | | | | |__| | |_| | | | | | | __/ |__| | | (_| | | (_) | (_| |
31+
|_____|_| |_| |_|\_____|\__,_|_|_| |_|_|\___|_____/|_|\__,_|_|\___/ \__, |
32+
_________________________________________________________________________/ |
33+
|__________________________________________________________________________/
34+
___ __ __
35+
/ _ \ / / / /
36+
__ _| | | |/ /_ / /_
37+
\ \ / / | | | '_ \| '_ \
38+
\ V /| |_| | (_) | (_) |
39+
\_/ \___(_)___(_)___/
40+
2641
-----------------------------------------------------------------------------------------------------------------
2742
-----------------------------------------------------------------------------------------------------------------
2843

0 commit comments

Comments
 (0)