Closed Bug 75551 Opened 25 years ago Closed 25 years ago

[API] need a case INSENSITIVE way to search an nsAReadableString

Categories

(Core :: XPCOM, defect, P1)

defect

Tracking

()

RESOLVED FIXED
mozilla0.9.1

People

(Reporter: mjudge, Assigned: scc)

References

Details

Attachments

(1 file)

this is blocking the editor right now, the only way around this for now is to copy the string to an nsString and use the nsString methods. We need a helper function that can accept some iterators and return usual compare result for ASCII text compares.
case insensitive search, case insensitive compare; this is an encoding issue, api issue, and related to work I want to do on string `alogorithms', that is, more functions like |copy_string| that take one or more strings and iterate over them applying the caller-supplied visitor to each hunk, and testing for completion
Blocks: 73009
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla1.0
It's unlikely I'll have a bug free version for you by tree-closure tonight, but I'll bust my butt to try to give it to you. Based on conversations with you and others on IRC, I'm calling this my most important 0.9 bug. We should communicate this fact to drivers to help get it in after the fact if we miss tonights deadline.
Priority: -- → P1
Target Milestone: mozilla1.0 → mozilla0.9
These are the 0.9 bugs that didn't make it, and that I intend to fix in 0.9.1
Target Milestone: mozilla0.9 → mozilla0.9.1
Summary: need a case INSENSITIVE way to search an nsAReadableString → [API] need a case INSENSITIVE way to search an nsAReadableString
re-targeting milestones, starting from a clean slate
Target Milestone: mozilla0.9.1 → ---
marking the functionality blockers for immediate attention in mozilla0.9.1
Target Milestone: --- → mozilla0.9.1
and I'm in the midst of testing it
Keywords: approval, patch, review
Looks good. Just one comment: +class CaseInsensitiveCharComparator + { + public: + PRBool operator()( char lhs, char rhs ) const { return nsCRT::ToUpper(lhs) == nsCRT::ToUpper(rhs); } + }; Will the calls to nsCRT::ToUpper be inlined? If no, this could be a bottleneck. Can we call toupper directly? sr=sfraser if you think that's not an issue.
r=jst
re: sfraser's comments --- I actually _do_ think it's an issue. Perhaps for ASCII I should be building a different mechanism. The |PRUnichar| version is not |inline|able, since it goes into the i18n code that theorecically does it right using code around very compressed tables. The |char| version, though, could be made to do the right thing. All these routines are wrong headed though, because they presume a flat encoding, when no such promise has been made. At least they continue to offer the level of functionality people need.
patch checked in
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Any plans for CaseInsensitiveRFindInReadable?
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: