[Everywhere] FileInfo::hasExtension for multiple values (#9774)

* [Base] Add hasExtension for multiple values

* [Gui] Use hasExtension for multiple values

* [Drawing] Use hasExtension for multiple values

* [Fem] Use hasExtension for multiple values

* [Import] Use hasExtension for multiple values

* [Mesh] Use hasExtension for multiple values

* [Part] Use hasExtension for multiple values

* [TechDraw] Use hasExtension for multiple values
This commit is contained in:
Benjamin Bræstrup Sayoc
2023-08-07 17:55:19 +02:00
committed by GitHub
parent 9587393ca3
commit 33384cff9c
16 changed files with 56 additions and 68 deletions

View File

@@ -316,6 +316,16 @@ bool FileInfo::hasExtension(const char* Ext) const
#endif
}
bool FileInfo::hasExtension(std::initializer_list<const char*> Exts) const
{
for (const char* Ext : Exts) {
if (hasExtension(Ext)) {
return true;
}
}
return false;
}
bool FileInfo::exists() const
{
#if defined (FC_OS_WIN32)

View File

@@ -90,6 +90,8 @@ public:
std::string completeExtension () const;
/// Checks for a special extension, NOT case sensitive
bool hasExtension (const char* Ext) const;
/// Checks for any of the special extensions, NOT case sensitive
bool hasExtension (std::initializer_list<const char*> Exts) const;
//@}
/** @name methods to test the status of the file or dir */