gecko-dev/intl
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
..
benchmarks Bug 1717060 - Create a micro benchmark for Intl.NumberFormat; r=nordzilla 2021-06-24 13:06:26 +00:00
build Bug 1686616 - register all Services.py services with components.conf. r=kmag,necko-reviewers,valentin 2021-02-18 13:26:28 +00:00
components Bug 1767961 - Part 4: Make TryCreateFromSkeleton a private method. r=platform-i18n-reviewers,dminor 2022-05-05 15:00:35 +00:00
docs Bug 1753413 - fx doc: Remove whitespaces, trailing lines & windows CR r=andi,perftest-reviewers,sparky 2022-02-03 18:34:58 +00:00
encoding_glue Bug 1701828 - meta charset rewrite. r=smaug 2021-12-08 11:34:20 +00:00
gtest Bug 1603127 - Replaced mozilla::Tuple with std::tuple and applied structured bindings in mozilla/Encoding.h. r=hsivonen 2021-11-08 08:14:00 +00:00
hyphenation Bug 1738401 - Remove -Wno-shadow warning suppressions. r=firefox-build-system-reviewers,glandium 2021-12-01 06:40:04 +00:00
icu Bug 1766220: Backport ICU-21994 to fix a potential heap buffer overflow. r=platform-i18n-reviewers,dminor 2022-04-25 16:34:42 +00:00
icu-patches Bug 1766220: Backport ICU-21994 to fix a potential heap buffer overflow. r=platform-i18n-reviewers,dminor 2022-04-25 16:34:42 +00:00
l10n Bug 1780788 - Use abstract strings as in-arguments for ipdl. r=nika,necko-reviewers,media-playback-reviewers,alwu,dragana 2022-07-25 20:19:48 +00:00
locale 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
locales Bug 1240277 - Add hyphenation patterns for Indic languages. r=platform-i18n-reviewers,dminor 2021-12-13 14:20:06 +00:00
lwbrk Bug 1774865 - extra cleanup mozglue, security, intl and netwerk includes r=sylvestre 2022-06-22 09:51:52 +00:00
strres 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
tzdata Bug 1763783 - Part 3: Update time zone data to tzdata2022a. r=platform-i18n-reviewers,jfkthame 2022-04-10 09:18:03 +00:00
uconv Bug 1667455 - Part 5: Stop importing Services.jsm from chrome-priv JS code, top-level single-line cases. r=kmag,webdriver-reviewers,perftest-reviewers,webcompat-reviewers,geckoview-reviewers,extension-reviewers,application-update-reviewers,pip-reviewers,twisniewski,m_kato,jdescottes,mconley,AlexandruIonescu,mossop 2022-07-11 12:41:50 +00:00
unicharutil Bug 1745113 Part 5 - Make grapheme cluster break iterators implement SegmentIteratorUtf16, and adapt the callers. r=necko-reviewers,jfkthame,kershaw 2022-01-13 18:36:04 +00:00
Encoding.h Bug 1603127 - Replaced mozilla::Tuple with std::tuple and applied structured bindings in mozilla/Encoding.h. r=hsivonen 2021-11-08 08:14:00 +00:00
EncodingDetector.h Bug 1686463 - Gather telemetry about automatic encoding detection outcomes. r=chutten,emk 2021-01-24 00:11:07 +00:00
ICU4X.md Bug 1736907 - Add a build flag to experimentally build with ICU4X static data; r=platform-i18n-reviewers,dminor 2021-11-16 15:09:09 +00:00
icu_sources_data.py Bug 1686052 - Part 2: Update ICU build script to use new "sources.txt" file. r=jwalden 2021-06-04 17:42:09 +00:00
moz.build Bug 1713627 - Remove code obsoleted by the replacing the Text Encoding menu with one item. r=jaws,emk 2021-06-21 12:09:01 +00:00
update-icu.sh Bug 1766220: Backport ICU-21994 to fix a potential heap buffer overflow. r=platform-i18n-reviewers,dminor 2022-04-25 16:34:42 +00:00
update-icu4x.sh Bug 1736907 - Add a build flag to experimentally build with ICU4X static data; r=platform-i18n-reviewers,dminor 2021-11-16 15:09:09 +00:00
update-tzdata.sh