From baafb3e290ce4a1cbd33726ba06a19ccf27ab468 Mon Sep 17 00:00:00 2001 From: Scott Wheeler Date: Sun, 1 Jan 2012 16:01:18 +0100 Subject: [PATCH] Funny that there managed to be no operator!= for String for so long. --- taglib/toolkit/tstring.cpp | 5 +++++ taglib/toolkit/tstring.h | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/taglib/toolkit/tstring.cpp b/taglib/toolkit/tstring.cpp index a9a1ee43..d85305d2 100644 --- a/taglib/toolkit/tstring.cpp +++ b/taglib/toolkit/tstring.cpp @@ -567,6 +567,11 @@ bool String::operator==(const String &s) const return d == s.d || d->data == s.d->data; } +bool String::operator!=(const String &s) const +{ + return !operator==(s); +} + String &String::operator+=(const String &s) { detach(); diff --git a/taglib/toolkit/tstring.h b/taglib/toolkit/tstring.h index 10b9f66a..2c782e12 100644 --- a/taglib/toolkit/tstring.h +++ b/taglib/toolkit/tstring.h @@ -357,6 +357,12 @@ namespace TagLib { */ bool operator==(const String &s) const; + /*! + * Compares each character of the String with each character of \a s and + * returns false if the strings match. + */ + bool operator!=(const String &s) const; + /*! * Appends \a s to the end of the String. */ -- 2.40.0