Closed Bug 131293 Opened 22 years ago Closed 21 years ago

StringBeginsWith and StringEndsWith

Categories

(Core :: XPCOM, defect, P2)

x86
Linux
defect

Tracking

()

RESOLVED FIXED
mozilla1.4final

People

(Reporter: dbaron, Assigned: dbaron)

Details

(Whiteboard: [patch])

Attachments

(1 file, 1 obsolete file)

I want to add StringBeginsWith and StringEndsWith to nsReadableUtils.  They're
very common operations.
See bug 64209 for an example of where they would be useful.
Target Milestone: --- → mozilla1.0
I'm all for it.
Status: NEW → ASSIGNED
Priority: -- → P2
Target Milestone: mozilla1.0 → mozilla1.1beta
Target Milestone: mozilla1.1beta → mozilla1.2alpha
Target Milestone: mozilla1.2alpha → Future
I should also add UTF8ToNewUnicode while I'm there...
Attached patch initial patch, untested (obsolete) — Splinter Review
I moved jag's UTF8 conversion character sinks out of string/obsolete/.	They
don't seem obsolete to me.  :-)  I'm wondering whether I should put them in
their own file -- very few customers actually need them, so perhaps they should
be in nsUTF8Utils.h instead of nsReadableUtils.h?
Target Milestone: Future → mozilla1.3alpha
Comment on attachment 102703 [details] [diff] [review]
initial patch, untested

I'd say lets move our UTF8 conversion utils into a seperate file.

On String*With:
I guess the check for sub_len > src_len is pretty cheap, but very likely the
odd case, and since operator== (or rather, Equals) does a length comparison
itself, perhaps we could leave it out?
Comment on attachment 102703 [details] [diff] [review]
initial patch, untested

nice! sr=alecf
I am looking forward to using the UTF8 converter class in some of my other
stuff too.
Attachment #102703 - Flags: superreview?(alecf) → superreview+
> On String*With:
> I guess the check for sub_len > src_len is pretty cheap, but very likely the
> odd case, and since operator== (or rather, Equals) does a length comparison
> itself, perhaps we could leave it out?

We can't leave it out, since that would mean that |Substring| would be given
invalid parameters.  Or we could leave it out and make the parameters to
substring much more complicated.
Attached patch revised patchSplinter Review
Use a separate file.  (Code also recopied from the current version.)
Attachment #102703 - Attachment is obsolete: true
Attachment #123819 - Flags: superreview?(alecf)
Attachment #123819 - Flags: review?(jaggernaut)
Target Milestone: mozilla1.3alpha → mozilla1.4final
Comment on attachment 123819 [details] [diff] [review]
revised patch

r=jst
Attachment #123819 - Flags: review?(jaggernaut) → review+
Comment on attachment 123819 [details] [diff] [review]
revised patch

this looks great! sr=alecf
Comment on attachment 123819 [details] [diff] [review]
revised patch

oops, sr=alecf
Attachment #123819 - Flags: superreview?(alecf) → superreview+
Comment on attachment 123819 [details] [diff] [review]
revised patch

sr=jag
Comment on attachment 123819 [details] [diff] [review]
revised patch

Requesting 1.4 approval -- this is low risk since all it's doing is moving code
and adding new functions that aren't used yet.	However, I think it would be
good to have it on the branch since if it's not on the branch it might make it
harder to move patches from trunk to branch (since we're likely to start using
these functions on the trunk).
Attachment #123819 - Flags: approval1.4?
Comment on attachment 123819 [details] [diff] [review]
revised patch

a=asa (on behalf of drivers) for checkin to 1.4.
Attachment #123819 - Flags: approval1.4? → approval1.4+
Fix checked in to trunk, 2003-05-21 15:20 -0700.
Status: ASSIGNED → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Attachment #102703 - Flags: review?(jaggernaut)
Component: String → XPCOM
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: