Add support for shader hotreloading
This commit is contained in:
@@ -20,6 +20,8 @@ namespace Nz
|
||||
// std::string is assumed to contains UTF-8
|
||||
NAZARA_CORE_API std::size_t ComputeCharacterCount(const std::string_view& str);
|
||||
|
||||
inline bool EndsWith(const std::string_view& str, const std::string_view& s);
|
||||
|
||||
NAZARA_CORE_API std::string FromUtf16String(const std::u16string_view& u16str);
|
||||
NAZARA_CORE_API std::string FromUtf32String(const std::u32string_view& u32str);
|
||||
NAZARA_CORE_API std::string FromWideString(const std::wstring_view& str);
|
||||
|
||||
@@ -10,6 +10,20 @@
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
inline bool EndsWith(const std::string_view& str, const std::string_view& s)
|
||||
{
|
||||
//FIXME: Replace with proper C++20 value once it's available
|
||||
#if __cplusplus > 201703L
|
||||
// C++20
|
||||
return str.ends_with(s);
|
||||
#else
|
||||
if (s.size() > str.size())
|
||||
return false;
|
||||
|
||||
return str.compare(str.size() - s.size(), s.size(), s.data()) == 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
inline bool IsNumber(std::string_view str)
|
||||
{
|
||||
if (str.empty())
|
||||
|
||||
Reference in New Issue
Block a user