summaryrefslogtreecommitdiff
path: root/include/i18nlangtag/languagetag.hxx
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2014-05-21 14:13:23 +0200
committerEike Rathke <erack@redhat.com>2014-05-21 14:15:24 +0200
commita6e6cc49bfbf594aa59804ee0d9751d5ff19caba (patch)
treea0b22ab7085a7ba7016cd8636e75b1231f99495d /include/i18nlangtag/languagetag.hxx
parentf824604b5c1b480bf6680935362eb1d4617187c9 (diff)
add static LanguageTag::isValidBcp47()
Change-Id: I2c646b3e2f13a6fccc845ce8eb82fccee154f3c6
Diffstat (limited to 'include/i18nlangtag/languagetag.hxx')
-rw-r--r--include/i18nlangtag/languagetag.hxx16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/i18nlangtag/languagetag.hxx b/include/i18nlangtag/languagetag.hxx
index dcb95c61d911..0e12235c34ba 100644
--- a/include/i18nlangtag/languagetag.hxx
+++ b/include/i18nlangtag/languagetag.hxx
@@ -228,6 +228,8 @@ public:
/** If this is a valid BCP 47 language tag.
Always resolves an empty tag to the system locale.
+
+ @seealso static bool isValidBcp47(const OUString&)
*/
bool isValidBcp47() const;
@@ -479,6 +481,20 @@ public:
*/
static com::sun::star::lang::Locale convertToLocaleWithFallback( const OUString& rBcp47 );
+ /** If rString represents a valid BCP 47 language tag.
+
+ Never resolves an empty tag to the system locale, in fact an empty
+ string is invalid here. Does not create an instance to be registered
+ with a conversion to Locale or LanguageType.
+
+ @param o_pCanonicalized
+ If given and rString is a valid BCP 47 language tag, the
+ canonicalized form is assigned, which may differ from the
+ original string even if that was a valid tag. If rString is not
+ a valid tag, nothing is assigned.
+ */
+ static bool isValidBcp47( const OUString& rString, OUString* o_pCanonicalized = NULL );
+
/** If nLang is a generated on-the-fly LangID */
static bool isOnTheFlyID( LanguageType nLang );