Skip to main content

Module sort

Module sort 

Source
Expand description

The order of the in-app picker’s entries: by which column, up or down, folders first or among the files, names read naturally.

use std::cmp::Ordering;
use egui_pop_api::files::sort::{PickerSort, SortColumn, natural_cmp};

assert_eq!(natural_cmp("IMG_9.cr3", "IMG_10.cr3"), Ordering::Less);
let newest = PickerSort::default().click(SortColumn::Modified);
assert_eq!(newest.as_text(), "-modified");
assert_eq!(PickerSort::parse("-modified"), Some(newest));

Structs§

PickerSort
The order of the picker’s entries. A listing always has one: unlike the data table’s, a header’s click goes up and down, never to no order.

Enums§

SortColumn
What the picker’s and the file browser’s entries are sorted by.

Functions§

natural_cmp
Compares names as people read them: a run of digits is a number (IMG_9 before IMG_10), and case does not matter. Names that read the same (a and A, 01 and 1) take the order of their characters, so that this is a total order. It compares characters, not a language’s collation: é comes after z.