Fix merge

This commit is contained in:
Lynix
2020-02-25 20:22:46 +01:00
parent cb66dddd45
commit 7bbba14ba0
10 changed files with 97 additions and 26 deletions

View File

@@ -29,6 +29,9 @@ namespace Nz
inline bool IsNumber(const char* str);
inline bool IsNumber(const std::string_view& str);
inline bool MatchPattern(const std::string_view& str, const char* pattern);
NAZARA_CORE_API bool MatchPattern(const std::string_view& str, const std::string_view& pattern);
template<typename... Args> bool StartsWith(const std::string_view& str, const char* s, Args&&... args);
inline bool StartsWith(const std::string_view& str, const std::string_view& s);
NAZARA_CORE_API bool StartsWith(const std::string_view& str, const std::string_view& s, CaseIndependent);

View File

@@ -21,6 +21,14 @@ namespace Nz
return !str.empty() && std::find_if(str.begin(), str.end(), [](unsigned char c) { return !std::isdigit(c); }) == str.end();
}
bool MatchPattern(const std::string_view& str, const char* pattern)
{
if (!pattern)
return false;
return MatchPattern(str, std::string_view(pattern, std::strlen(pattern)));
}
template<typename... Args> bool StartsWith(const std::string_view& str, const char* s, Args&&... args)
{
std::size_t size = std::strlen(s);

View File

@@ -48,8 +48,8 @@ namespace Nz
inline VkResult GetLastErrorCode() const;
inline VkPhysicalDevice GetPhysicalDevice() const;
inline bool IsExtensionLoaded(const String& extensionName);
inline bool IsLayerLoaded(const String& layerName);
inline bool IsExtensionLoaded(const std::string& extensionName);
inline bool IsLayerLoaded(const std::string& layerName);
inline bool WaitForIdle();
@@ -219,8 +219,8 @@ namespace Nz
VkDevice m_device;
VkPhysicalDevice m_physicalDevice;
VkResult m_lastErrorCode;
std::unordered_set<String> m_loadedExtensions;
std::unordered_set<String> m_loadedLayers;
std::unordered_set<std::string> m_loadedExtensions;
std::unordered_set<std::string> m_loadedLayers;
std::vector<QueueFamilyInfo> m_enabledQueuesInfos;
std::vector<const QueueList*> m_queuesByFamily;
};

View File

@@ -68,12 +68,12 @@ namespace Nz
return m_physicalDevice;
}
inline bool Device::IsExtensionLoaded(const String& extensionName)
inline bool Device::IsExtensionLoaded(const std::string& extensionName)
{
return m_loadedExtensions.count(extensionName) > 0;
}
inline bool Device::IsLayerLoaded(const String& layerName)
inline bool Device::IsLayerLoaded(const std::string& layerName)
{
return m_loadedLayers.count(layerName) > 0;
}