added operator==() and operator!=() to LanguageTag

Change-Id: I4f339ecaeb147a05f8882065e859902f8c14ac47
This commit is contained in:
Eike Rathke
2012-11-21 19:11:56 +01:00
parent 4cf30c6c2a
commit 6a05d3f816
2 changed files with 19 additions and 0 deletions

View File

@@ -196,6 +196,12 @@ public:
*/
LanguageTag & makeFallback();
/* Test equality of two LangageTag. */
bool operator==( const LanguageTag & rLanguageTag ) const;
/* Test inequality of two LangageTag. */
bool operator!=( const LanguageTag & rLanguageTag ) const;
private:
enum Decision

View File

@@ -839,4 +839,17 @@ LanguageTag & LanguageTag::makeFallback()
}
bool LanguageTag::operator==( const LanguageTag & rLanguageTag ) const
{
// Compare full language tag strings but SYSTEM unresolved.
return getBcp47( false) == rLanguageTag.getBcp47( false);
}
bool LanguageTag::operator!=( const LanguageTag & rLanguageTag ) const
{
return !operator==( rLanguageTag);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */