issue 3598 and 2289 - util functions to determine file types by ending

This commit is contained in:
FelixJongleur42
2017-01-19 22:22:49 +01:00
committed by Flössie
parent c94e017d90
commit 62451f471f
7 changed files with 66 additions and 43 deletions

View File

@@ -19,6 +19,7 @@
#pragma once
#include <type_traits>
#include <glibmm.h>
namespace rtengine
{
@@ -42,4 +43,24 @@ typename std::underlying_type<ENUM>::type toUnderlying(ENUM value)
return static_cast<typename std::underlying_type<ENUM>::type>(value);
}
/**
* Return lower case extension without the "." or "" if the given name contains no "."
*/
Glib::ustring getFileExtension(const Glib::ustring &fname);
/**
* Return true if file has .jpeg or .jpg extension (ignoring case)
*/
bool hasJpegExtension(const Glib::ustring &fname);
/**
* Return true if file has .tiff or .tif extension (ignoring case)
*/
bool hasTiffExtension(const Glib::ustring &fname);
/**
* Return true if file has .png extension (ignoring case)
*/
bool hasPngExtension(const Glib::ustring &fname);
}