4 #include <libvisual/lvconfig.h>
5 #include <libvisual/lv_defines.h>
12 template<
typename T,
typename ...Args>
13 std::unique_ptr<T> make_unique( Args&& ...args )
15 return std::unique_ptr<T> (
new T (std::forward<Args> (args)... ));
26 inline bool str_has_suffix (std::string
const& str, std::string
const& suffix)
28 if (str.length() >= suffix.length()) {
29 return (str.compare (str.length() - suffix.length(), suffix.length(), suffix) == 0);
35 LV_API
bool for_each_file_in_dir (std::string
const& path,
36 std::function<
bool (std::string
const&)> filter,
37 std::function<
bool (std::string
const&)> func);
48 return !
string.empty () ?
string.c_str () :
nullptr;
53 #endif // _LV_UTIL_HPP