diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/language_tag.cc | 27 | ||||
| -rw-r--r-- | src/language_tag.h | 18 |
2 files changed, 12 insertions, 33 deletions
diff --git a/src/language_tag.cc b/src/language_tag.cc index 532dd557..8faf226c 100644 --- a/src/language_tag.cc +++ b/src/language_tag.cc @@ -332,33 +332,6 @@ LanguageTag::subtag_type_name (SubtagType type) return {}; } -bool -dcp::LanguageTag::VariantSubtag::operator== (VariantSubtag const & other) const -{ - return subtag() == other.subtag(); -} - - -bool -dcp::LanguageTag::VariantSubtag::operator< (VariantSubtag const & other) const -{ - return subtag() < other.subtag(); -} - - -bool -dcp::LanguageTag::ExtlangSubtag::operator== (ExtlangSubtag const & other) const -{ - return subtag() == other.subtag(); -} - - -bool -dcp::LanguageTag::ExtlangSubtag::operator< (ExtlangSubtag const & other) const -{ - return subtag() < other.subtag(); -} - bool dcp::operator== (dcp::LanguageTag const& a, dcp::LanguageTag const& b) diff --git a/src/language_tag.h b/src/language_tag.h index 1c7faa44..6f46c16b 100644 --- a/src/language_tag.h +++ b/src/language_tag.h @@ -71,6 +71,10 @@ public: bool operator== (SubtagData const& other) const { return subtag == other.subtag && description == other.description; } + + bool operator!=(SubtagData const& other) const { + return subtag != other.subtag || description != other.description; + } }; enum class SubtagType @@ -97,6 +101,14 @@ public: return _subtag == other._subtag; } + bool operator!=(Subtag const& other) const { + return _subtag != other._subtag; + } + + bool operator<(Subtag const& other) const { + return _subtag < other._subtag; + } + protected: Subtag (std::string subtag, SubtagType type); @@ -154,9 +166,6 @@ public: SubtagType type () const override { return SubtagType::VARIANT; } - - bool operator== (VariantSubtag const& other) const; - bool operator< (VariantSubtag const& other) const; }; @@ -171,9 +180,6 @@ public: SubtagType type () const override { return SubtagType::EXTLANG; } - - bool operator== (ExtlangSubtag const& other) const; - bool operator< (ExtlangSubtag const& other) const; }; LanguageTag () {} |
