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
build
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
gtest
hyphenation
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
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
EncodingDetector.h
ICU4X.md
icu_sources_data.py
moz.build
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
update-tzdata.sh