diff options
Diffstat (limited to 'src/FileAnalyzer.cpp')
-rw-r--r-- | src/FileAnalyzer.cpp | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/src/FileAnalyzer.cpp b/src/FileAnalyzer.cpp index 0178789..a24906f 100644 --- a/src/FileAnalyzer.cpp +++ b/src/FileAnalyzer.cpp @@ -1,6 +1,7 @@ #include "../include/FileAnalyzer.hpp" #include "../include/AsyncImageLoader.hpp" #include "../include/Program.hpp" +#include "../include/StringUtils.hpp" #include <sys/stat.h> #include <stdio.h> #include <array> @@ -92,29 +93,29 @@ namespace QuickMedia { } bool is_image_ext(const char *ext) { - return strcasecmp(ext, ".jpg") == 0 - || strcasecmp(ext, ".jpeg") == 0 - || strcasecmp(ext, ".png") == 0 - || strcasecmp(ext, ".gif") == 0 - || strcasecmp(ext, ".webp") == 0; + return strcase_equals(ext, ".jpg") + || strcase_equals(ext, ".jpeg") + || strcase_equals(ext, ".png") + || strcase_equals(ext, ".gif") + || strcase_equals(ext, ".webp"); } bool is_video_ext(const char *ext) { - return strcasecmp(ext, ".webm") == 0 - || strcasecmp(ext, ".mkv") == 0 - || strcasecmp(ext, ".flv") == 0 - || strcasecmp(ext, ".vob") == 0 - || strcasecmp(ext, ".ogv") == 0 - || strcasecmp(ext, ".avi") == 0 - //|| strcasecmp(ext, ".ts") == 0 - || strcasecmp(ext, ".mov") == 0 - || strcasecmp(ext, ".qt") == 0 - || strcasecmp(ext, ".wmv") == 0 - || strcasecmp(ext, ".mp4") == 0 - || strcasecmp(ext, ".m4v") == 0 - || strcasecmp(ext, ".mpg") == 0 - || strcasecmp(ext, ".mpeg") == 0 - || strcasecmp(ext, ".3gp") == 0; + return strcase_equals(ext, ".webm") + || strcase_equals(ext, ".mkv") + || strcase_equals(ext, ".flv") + || strcase_equals(ext, ".vob") + || strcase_equals(ext, ".ogv") + || strcase_equals(ext, ".avi") + //|| strcase_equals(ext, ".ts") + || strcase_equals(ext, ".mov") + || strcase_equals(ext, ".qt") + || strcase_equals(ext, ".wmv") + || strcase_equals(ext, ".mp4") + || strcase_equals(ext, ".m4v") + || strcase_equals(ext, ".mpg") + || strcase_equals(ext, ".mpeg") + || strcase_equals(ext, ".3gp"); } static int accumulate_string(char *data, int size, void *userdata) { |