added operator==() and operator!=() to LanguageTag
Change-Id: I4f339ecaeb147a05f8882065e859902f8c14ac47
This commit is contained in:
@@ -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
|
||||
|
@@ -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: */
|
||||
|
Reference in New Issue
Block a user