diff options
author | Eike Rathke <erack@redhat.com> | 2022-08-31 14:08:26 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2022-08-31 20:49:46 +0200 |
commit | 2c2e0568e89942cc8463c0da9aa7a3d177667178 (patch) | |
tree | 56eef8bd675da9b766dcc57bdc7c5181c05728b8 /include | |
parent | 08385a624cbcd6d3de3476c76511545d4034a931 (diff) |
Related: tdf#150370 Convert isValidBcp47() bool to enum LanguageTag::PrivateUse
... to prepare for more finegrained private-use control.
Change-Id: I118c3f5ee6e437435c07ed2cf699c4597e9cdf88
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139112
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
Diffstat (limited to 'include')
-rw-r--r-- | include/i18nlangtag/languagetag.hxx | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/include/i18nlangtag/languagetag.hxx b/include/i18nlangtag/languagetag.hxx index 3b5fb3d6d445..5b9a43c05d81 100644 --- a/include/i18nlangtag/languagetag.hxx +++ b/include/i18nlangtag/languagetag.hxx @@ -515,6 +515,13 @@ public: */ static LanguageType convertToLanguageTypeWithFallback( const css::lang::Locale& rLocale ); + /** Enums to be used with isValidBcp47(). */ + enum PrivateUse + { + ALLOW = 0, + DISALLOW + }; + /** If rString represents a valid BCP 47 language tag. Never resolves an empty tag to the system locale, in fact an empty @@ -527,13 +534,13 @@ public: original string even if that was a valid tag. If rString is not a valid tag, nothing is assigned. - @param bDisallowPrivate - If TRUE, valid tags according to BCP 47 but reserved for - private use, like 'x-...', are not allowed and FALSE is - returned in this case. + @param ePrivateUse + If PrivateUse::DISALLOW, valid tags according to BCP 47 but + reserved for private use, like 'x-...', are not allowed and + FALSE is returned in this case. */ static bool isValidBcp47( const OUString& rString, OUString* o_pCanonicalized, - bool bDisallowPrivate = false ); + PrivateUse ePrivateUse = PrivateUse::ALLOW ); /** If nLang is a generated on-the-fly LangID */ static bool isOnTheFlyID( LanguageType nLang ); |