Opened 12 years ago
Last modified 8 years ago
#9268 assigned enhancement
BStringList::Sort with own comparing method.
Reported by: | dknoto | Owned by: | nobody |
---|---|---|---|
Priority: | normal | Milestone: | Unscheduled |
Component: | Kits/Support Kit | Version: | R1/Development |
Keywords: | BString, Sort, compare | Cc: | |
Blocked By: | Blocking: | ||
Platform: | All |
Description
I added sorting through his own method of comparing the string.
Attachments (3)
Change History (11)
comment:1 by , 12 years ago
patch: | 0 → 1 |
---|
by , 12 years ago
Attachment: | StringList-Test-2.tar.xz added |
---|
by , 12 years ago
Attachment: | StringList-Sort-2.patch added |
---|
comment:2 by , 12 years ago
Please remove files StringList-Test-2.tar.2.xz and StringList-Test-2.tar.3.xz. Web+ has some bug.
comment:3 by , 12 years ago
As commented in #9267 please use git format-patch
to create your patches.
Regarding this patch, intended is a Sort()
method with a compare function that operates on const BString&
and maybe a second one with const char*
parameters. That essentially means avoiding BList::SortItems() and rather using std::sort()
directly on BList::Items()
with a respective comparison class. That would also be a preferable alternative for the existing Sort()
method.
Please mind our coding style guidelines. There should be two blank lines between function definitions.
comment:4 by , 12 years ago
Okay, these are my first programing steps in this system. I will try to learn the local customs as soon as possible ;-)
by , 12 years ago
Attachment: | 0002-BStringList-implemented-Sort-with-custom-sort-functi.patch added |
---|
comment:5 by , 12 years ago
Just to avoid a misunderstanding: The patch (though properly formatted now :-)) doesn't address what the TODO intended. The new Sort()
method(s) should have a function argument that compares strings. The Sort()
method your patch adds works, of course, but it isn't convenient to use.
comment:6 by , 12 years ago
It seems to me that this approach is difficult. I'm going to develop better version ;-)
comment:7 by , 10 years ago
Milestone: | R1 → Unscheduled |
---|
comment:8 by , 8 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
Testing program.