This is the bug/patch tracker for Rockbox. Click here for more information.
Quick links: Bugs · Patches · Rockbox frontpage
FS#8314 - Natural numeric sorting
Attached to Project:
Rockbox
Opened by Nicolas Pennequin (nicolas_p) - Thursday, 13 December 2007, 17:48 GMT+2
Last edited by Nicolas Pennequin (nicolas_p) - Thursday, 13 December 2007, 17:49 GMT+2
Opened by Nicolas Pennequin (nicolas_p) - Thursday, 13 December 2007, 17:48 GMT+2
Last edited by Nicolas Pennequin (nicolas_p) - Thursday, 13 December 2007, 17:49 GMT+2
|
DetailsThis patch adds strnatcmp and strnatcasecmp, that are able to compare strings using natural numeric sorting. It also makes the trivial changes necessary to make use of this sorting in the file browser, without adding a setting.
This is very similar to * It is not limited to leading numbers in a string * It does not require a setting. strnatcmp and strnatcasecmp are drop-in replacements for strcmp and strcasecmp. * It is much more generic and can be used anywhere else in the core. The file browser use is probably not the only place where we'd want to use natural sorting. One thing that will be needed is to implement strnnatcmp and strnnatcasecmp. This patch adds 628 bytes to a gigabeat build. The code was written by Martin Pool and is available under the zlib license at http://sourcefrog.net/projects/natsort/ I found it and was inspired to port it to Rockbox thanks to http://www.codinghorror.com/blog/archives/001018.html |
This task depends upon