gecko-dev/intl/locale
Nika Layzell c15823d075 Bug 1772006 - Part 5: Simplify and move the string searching APIs from ns[T]StringObsolete, r=xpcom-reviewers,necko-reviewers,eeejay,dragana,barret
The biggest set of APIs from ns[T]StringObsolete which are still heavily used
are the string searching APIs. It appears the intention was for these to be
replaced by the `FindInReadable` APIs, however that doesn't appear to have
happened.

In addition, the APIs have some quirks around their handling of mixed character
widths. These APIs generally supported both narrow strings and the native
string type, probably because char16_t string literals weren't available until
c++11. Finally they also used easy-to-confuse unlabeled boolean and integer
optional arguments to control behaviour.

These patches do the following major changes to the searching APIs:

1. The ASCII case-insensitive search method was split out as
   LowerCaseFindASCII, rather than using a boolean. This should be less
   error-prone and more explicit, and allows the method to continue to use
   narrow string literals for all string types (as only ASCII is supported).
2. The other [R]Find methods were restricted to only support arguments with
   matching character types. I considered adding a FindASCII method which would
   use narrow string literals for both wide and narrow strings but it would've
   been the same amount of work as changing all of the literals to unicode
   literals.
   This ends up being the bulk of the changes in the patch.
3. All find methods were re-implemented using std::basic_string_view's find
   algorithm or stl algorithms to reduce code complexity, and avoid the need to
   carry around the logic from nsStringObsolete.cpp.
4. The implementations were moved to nsTStringRepr.cpp.
5. An overload of Find was added to try to catch callers which previously
   called `Find(..., false)` or `Find(..., true)` to set case-sensitivity, due
   to booleans normally implicitly coercing to `index_type`. This should
   probably be removed at some point, but may be useful during the transition.

Differential Revision: https://phabricator.services.mozilla.com/D148300
2022-07-30 00:12:48 +00:00
..
android Bug 1725145 - Preparation for the hybrid build env. r=necko-reviewers,firefox-build-system-reviewers,valentin,glandium 2021-08-25 10:46:17 +00:00
gtk Bug 1719553 - Use unified Intl API in OSPreferences_gtk.cpp; r=platform-i18n-reviewers,dminor 2021-11-29 20:43:07 +00:00
mac Bug 1725145 - Preparation for the hybrid build env. r=necko-reviewers,firefox-build-system-reviewers,valentin,glandium 2021-08-25 10:46:17 +00:00
rust
tests Bug 1772006 - Part 5: Simplify and move the string searching APIs from ns[T]StringObsolete, r=xpcom-reviewers,necko-reviewers,eeejay,dragana,barret 2022-07-30 00:12:48 +00:00
windows Bug 1758997 - Remove RoInitialize/RoUninitialize from OSPreferences_win. r=Jamie 2022-03-11 10:02:32 +00:00
AppDateTimeFormat.cpp Bug 1755961 - Delete the format cache in AppDateTimeFormat; r=platform-i18n-reviewers,dminor 2022-03-30 21:10:46 +00:00
AppDateTimeFormat.h Bug 1755181 - Invalidate locale cache in AppDateTimeFormat; r=platform-i18n-reviewers,nordzilla 2022-03-22 15:19:47 +00:00
LangPackMatcher.sys.mjs Bug 1779621 - Migrate intl/locale from jsm to esm; r=nordzilla 2022-07-26 12:28:41 +00:00
LocaleService.cpp Backed out changeset 94420b6eff4c (bug 1297520) for xpcshell failures on test_snap.js 2022-07-06 19:16:34 +03:00
LocaleService.h Bug 1734679 - Fix regression for XSLT sorting with an invalid language tag; r=platform-i18n-reviewers,dminor 2021-10-08 19:10:48 +00:00
MozLocaleBindings.h
OSPreferences.cpp Bug 1719551 - Part 2: Unify Intl API in OSPreferences. r=platform-i18n-reviewers,gregtatum 2021-10-19 07:34:01 +00:00
OSPreferences.h
PluralForm.sys.mjs Bug 1779621 - Migrate intl/locale from jsm to esm; r=nordzilla 2022-07-26 12:28:41 +00:00
Quotes.cpp Bug 1733659 - Clean up naming style in Locale; r=platform-i18n-reviewers,gregtatum 2021-11-23 12:36:41 +00:00
Quotes.h
cldr-quotes.inc Bug 1738903 - Update locale-specific quotation-mark data to CLDR release 40.0. r=platform-i18n-reviewers,dminor 2021-11-04 14:06:21 +00:00
cldr-quotes.pl Bug 1738903 - Update locale-specific quotation-mark data to CLDR release 40.0. r=platform-i18n-reviewers,dminor 2021-11-04 14:06:21 +00:00
components.conf Bug 1719550 - Remove nsCollation; r=platform-i18n-reviewers,nordzilla 2021-08-10 16:01:19 +00:00
encodingsgroups.properties
language.properties Bug 1059603: Add pt-PT to available Accept-Languages locale, r=eemeli 2022-02-07 16:45:07 +00:00
moz.build Bug 1779621 - Migrate intl/locale from jsm to esm; r=nordzilla 2022-07-26 12:28:41 +00:00
mozILocaleService.idl
mozIOSPreferences.idl
nsLanguageAtomService.cpp Bug 1772006 - Part 4: Simplify and move the string comparison APIs from ns[T]StringObsolete, r=xpcom-reviewers,necko-reviewers,dragana,barret 2022-07-30 00:12:48 +00:00
nsLanguageAtomService.h Bug 1729642 - patch 1 - Make shutdown of nsLanguageAtomService explicit instead of relying on ClearOnShutdown. r=platform-i18n-reviewers,dminor 2021-09-14 18:51:49 +00:00
nsUConvPropertySearch.cpp Bug 1772006 - Part 4: Simplify and move the string comparison APIs from ns[T]StringObsolete, r=xpcom-reviewers,necko-reviewers,dragana,barret 2022-07-30 00:12:48 +00:00
nsUConvPropertySearch.h
props2arrays.py