StringBeginsWith and StringEndsWith

RESOLVED FIXED in mozilla1.4final

Status

()

Core
String
P2
normal
RESOLVED FIXED
17 years ago
15 years ago

People

(Reporter: dbaron, Assigned: dbaron)

Tracking

Trunk
mozilla1.4final
x86
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [patch])

Attachments

(1 attachment, 1 obsolete attachment)

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

Comment 2

17 years ago
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...
Created attachment 102703 [details] [diff] [review]
initial patch, untested

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?
Whiteboard: [patch]
Target Milestone: Future → mozilla1.3alpha
Attachment #102703 - Flags: review?(jaggernaut)

Comment 5

16 years ago
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?
Attachment #102703 - Flags: superreview?(alecf)

Comment 6

16 years ago
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.
Created attachment 123819 [details] [diff] [review]
revised patch

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 10

15 years ago
Comment on attachment 123819 [details] [diff] [review]
revised patch

this looks great! sr=alecf

Comment 11

15 years ago
Comment on attachment 123819 [details] [diff] [review]
revised patch

oops, sr=alecf
Attachment #123819 - Flags: superreview?(alecf) → superreview+

Comment 12

15 years ago
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 14

15 years ago
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
Last Resolved: 15 years ago
Resolution: --- → FIXED

Updated

15 years ago
Attachment #102703 - Flags: review?(jaggernaut)
You need to log in before you can comment on or make changes to this bug.