Browse Source

Add CarlaString operators back again, gcc is not that smart...

tags/1.9.4
falkTX 10 years ago
parent
commit
dd3d3bc6d0
1 changed files with 22 additions and 0 deletions
  1. +22
    -0
      source/utils/CarlaString.hpp

+ 22
- 0
source/utils/CarlaString.hpp View File

@@ -575,11 +575,21 @@ public:
return (strBuf != nullptr && std::strcmp(fBuffer, strBuf) == 0);
}

bool operator==(const CarlaString& str) const noexcept
{
return operator==(str.fBuffer);
}

bool operator!=(const char* const strBuf) const noexcept
{
return !operator==(strBuf);
}

bool operator!=(const CarlaString& str) const noexcept
{
return !operator==(str.fBuffer);
}

CarlaString& operator=(const char* const strBuf) noexcept
{
_dup(strBuf);
@@ -587,6 +597,13 @@ public:
return *this;
}

CarlaString& operator=(const CarlaString& str) noexcept
{
_dup(str.fBuffer);

return *this;
}

CarlaString& operator+=(const char* const strBuf) noexcept
{
if (strBuf == nullptr)
@@ -603,6 +620,11 @@ public:
return *this;
}

CarlaString& operator+=(const CarlaString& str) noexcept
{
return operator+=(str.fBuffer);
}

CarlaString operator+(const char* const strBuf) noexcept
{
const size_t newBufSize = fBufferLen + ((strBuf != nullptr) ? std::strlen(strBuf) : 0) + 1;


Loading…
Cancel
Save