another adjustments for string
This commit is contained in:
@@ -27,6 +27,7 @@ namespace OpenVulkano
|
||||
String(const std::string_view& str) : m_string(str) {}
|
||||
String(const String& other) : m_string(other.m_string) {}
|
||||
String(String&& other) noexcept : m_string(std::move(other.m_string)) {}
|
||||
String(std::string&& other) noexcept : m_string(std::move(other)) {}
|
||||
~String() = default;
|
||||
|
||||
template<typename T> String& operator=(const T& other)
|
||||
@@ -41,24 +42,32 @@ namespace OpenVulkano
|
||||
return *this;
|
||||
}
|
||||
|
||||
template<typename T> String& operator=(const String& other)
|
||||
String& operator=(const String& other)
|
||||
{
|
||||
m_string = other.m_string;
|
||||
return *this;
|
||||
}
|
||||
|
||||
String& operator=(String&& other)
|
||||
{
|
||||
m_string = std::move(other.m_string);
|
||||
return *this;
|
||||
}
|
||||
|
||||
template<typename T> String& operator+=(const T& other)
|
||||
{
|
||||
m_string += other;
|
||||
return *this;
|
||||
}
|
||||
|
||||
template<typename T> String& operator+=(const String& other)
|
||||
String& operator+=(const String& other)
|
||||
{
|
||||
m_string += other.m_string;
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
|
||||
template<typename T> String operator+(const T& other) const { return m_string + other; }
|
||||
String operator+(const String& other) const { return m_string + other.m_string; }
|
||||
|
||||
@@ -96,7 +105,7 @@ namespace OpenVulkano
|
||||
|
||||
String& Trim() noexcept { return TrimBack().TrimFront(); }
|
||||
|
||||
[[nodiscard]] String Trim() const { return Trim(); }
|
||||
[[nodiscard]] String Trim() const { return Trim(); }
|
||||
|
||||
String& TrimFront() noexcept
|
||||
{
|
||||
@@ -263,7 +272,7 @@ namespace OpenVulkano
|
||||
|
||||
int64_t HexToInt() { return HexToInt(m_string); }
|
||||
|
||||
static bool IsUrl(const std::string_view& str)
|
||||
static constexpr bool IsUrl(const std::string_view& str)
|
||||
{
|
||||
return str.find("http://") == 0 || str.find("https://") == 0 || str.find("ftp://") == 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user