37 lines
1.1 KiB
C++
37 lines
1.1 KiB
C++
#include <Tactility/StringUtils.h>
|
|
#include <Tactility/TactilityCore.h>
|
|
|
|
namespace tt::app::files {
|
|
|
|
constexpr auto* TAG = "Files";
|
|
|
|
bool isSupportedAppFile(const std::string& filename) {
|
|
return filename.ends_with(".app");
|
|
}
|
|
|
|
bool isSupportedImageFile(const std::string& filename) {
|
|
std::string filename_lower = string::lowercase(filename);
|
|
return filename_lower.ends_with(".png") ||
|
|
filename_lower.ends_with(".jpg") ||
|
|
filename_lower.ends_with(".jpeg");
|
|
}
|
|
|
|
bool isSupportedTextFile(const std::string& filename) {
|
|
std::string filename_lower = string::lowercase(filename);
|
|
return filename_lower.ends_with(".txt") ||
|
|
filename_lower.ends_with(".ini") ||
|
|
filename_lower.ends_with(".json") ||
|
|
filename_lower.ends_with(".yaml") ||
|
|
filename_lower.ends_with(".yml") ||
|
|
filename_lower.ends_with(".lua") ||
|
|
filename_lower.ends_with(".js") ||
|
|
filename_lower.ends_with(".properties");
|
|
}
|
|
|
|
bool isSupportedAudioFile(const std::string& filename) {
|
|
std::string filename_lower = string::lowercase(filename);
|
|
return filename_lower.ends_with(".mp3");
|
|
}
|
|
|
|
} // namespace tt::app::filebrowser
|