Closed Bug 212325 Opened 21 years ago Closed 13 years ago

Provide inline EqualsIgnoreCase and CompareIgnoreCase

Categories

(Core :: XPCOM, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: darin.moz, Unassigned)

Details

(Keywords: helpwanted)

Attachments

(1 obsolete file)

I really think we should provide inline wrappers around Equals(...
nsCaseInsensitive?StringComparator) and Compare to ease coding.  I can't stand
having to type so many characters to get case insensitive comparsion, and I'd
imagine others would agree with me.  Anyways, it is really easy to provide
inline wrappers, that don't in any way break the rule that xpcom shouldn't have
to depend on unicharutils, so why not?  I'll attach a concept patch shortly...
Attached patch v0 concept patch (obsolete) — Splinter Review
Attachment #127467 - Flags: superreview?(dbaron)
Attachment #127467 - Flags: review?(jaggernaut)
Did you try compiling this in a gcc debug build?
does gcc 3.1 20020420 (osx 10.2) count? ;)

what are your concerns about gcc?
Uhm... nsAString is frozen, so you can't add the member functions. And won't
lack of nsAString::EqualsIgnoreCase() when unicharutils isn't linked in give you
build errors?
>Uhm... nsAString is frozen, so you can't add the member functions. And won't
>lack of nsAString::EqualsIgnoreCase() when unicharutils isn't linked in give you
>build errors?

this doesn't break binary compatibility in any way shape or form.  the fact that
the interface is frozen doesn't prevent us from adding inline helper functions.

you'd only get linker errors if you tried to use nsAString::EqualsIgnoreCase
without including nsUnicharUtils.h, which is desirable i think.
Comment on attachment 127467 [details] [diff] [review]
v0 concept patch

Is this still relevant?  If so, could you provide an up-to-date patch?
Attachment #127467 - Flags: superreview?(dbaron)
Comment on attachment 127467 [details] [diff] [review]
v0 concept patch

yeah, i think this patch is still relevant.  i'll update it.
Attachment #127467 - Attachment is obsolete: true
Attachment #127467 - Flags: review?(jag)
Severity: normal → enhancement
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla1.8alpha
Hmm, I guestion the need for these to be inline... Having those methods is nice,
but do they need to be inlined, really?
good point.  they don't need to be inlined.  since callers have to link to
libunicharutil_s.a anyways, we could just implement nsAString::EqualsIgnoreCase
in there.
Keywords: helpwanted
Target Milestone: mozilla1.8alpha1 → Future
Assignee: darin → nobody
Status: ASSIGNED → NEW
QA Contact: scc → string
Target Milestone: Future → ---
I see some EqualsIgnoreCase functions in some string classes
(1. http://mxr.mozilla.org/mozilla-central/source/xpcom/string/src/nsStringObsolete.cpp#985 
2. http://mxr.mozilla.org/mozilla-central/source/xpcom/string/public/nsTString.h#258)

Moreover I see nsCaseInsensitiveCStringComparator class which has case insensitive comparator.
http://mxr.mozilla.org/mozilla-central/source/xpcom/string/public/nsAString.h#77

Do we still needs this for some other string classes like nsTSubString? If no, then we should close this bug as Resolved/WorksForMe.
Yeah, we fixed this a long time ago.
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → WORKSFORME
Component: String → XPCOM
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: