Sam Atkins
23aec16e8b
LibCore: Introduce a new directory iteration API
...
`Core::Directory::for_each_entry()` takes a callback which is passed the
DirectoryEntry and the parent Directory. It returns any error from
creating the iterator, iterating the entries, or returned from the
callback.
As a simple example, this:
```c++
Core::DirIterator piece_set_iterator { "/res/icons/chess/sets/",
Core::DirIterator::SkipParentAndBaseDir };
while (piece_set_iterator.has_next())
m_piece_sets.append(piece_set_iterator.next_path());
```
becomes this:
```c++
TRY(Core::Directory::for_each_entry("/res/icons/chess/sets/"sv,
Core::DirIterator::SkipParentAndBaseDir,
[&](auto const& entry, auto&) -> ErrorOr<IterationDecision> {
TRY(m_piece_sets.try_append(entry.name));
return IterationDecision::Continue;
}));
```
2023-03-05 20:23:42 +01:00
..
2023-01-27 20:38:49 +00:00
2022-12-31 04:24:05 -07:00
2023-01-04 11:49:15 +01:00
2023-03-03 15:23:47 +01:00
2023-03-01 10:47:19 +01:00
2023-03-05 20:23:42 +01:00
2023-02-13 00:50:07 +00:00
2022-12-06 08:54:33 +01:00
2023-02-13 00:50:07 +00:00
2023-02-13 00:50:07 +00:00
2023-01-27 20:38:49 +00:00
2023-01-04 11:49:15 +01:00
2023-01-12 11:25:51 +01:00
2023-03-05 20:23:42 +01:00
2023-02-13 00:50:07 +00:00
2023-03-05 20:23:42 +01:00
2023-03-05 20:23:42 +01:00
2023-03-05 20:23:42 +01:00
2023-03-05 20:23:42 +01:00
2023-03-05 20:23:42 +01:00
2023-03-05 20:23:42 +01:00
2023-01-07 14:51:04 +01:00
2023-01-07 14:51:04 +01:00
2022-12-06 08:54:33 +01:00
2023-02-13 00:50:07 +00:00
2023-01-11 11:49:05 +01:00
2023-02-13 00:50:07 +00:00
2023-02-16 10:56:01 +00:00
2022-12-06 08:54:33 +01:00
2023-01-19 11:29:48 +00:00
2023-01-18 09:37:11 -05:00
2023-01-19 11:29:48 +00:00
2023-01-18 09:37:11 -05:00
2023-01-18 09:37:11 -05:00
2023-02-16 10:56:01 +00:00
2023-02-08 19:49:48 +01:00
2023-02-25 22:31:17 +01:00
2022-12-06 08:54:33 +01:00
2022-12-06 08:54:33 +01:00
2023-01-29 19:16:44 -07:00
2023-02-13 00:50:07 +00:00
2023-02-13 00:50:07 +00:00
2023-02-16 10:56:01 +00:00
2023-02-16 10:56:01 +00:00
2023-02-24 19:44:20 +01:00
2023-01-20 15:13:31 +00:00
2023-02-13 00:50:07 +00:00
2023-02-13 00:50:07 +00:00
2023-01-01 09:55:05 -05:00
2023-01-26 09:57:14 -05:00
2023-02-25 20:51:49 +01:00
2023-02-08 19:15:45 +00:00
2023-02-13 00:50:07 +00:00
2023-02-13 00:50:07 +00:00
2022-12-06 08:54:33 +01:00
2022-12-09 00:05:30 +01:00
2023-01-04 11:49:15 +01:00
2023-02-08 19:49:48 +01:00
2023-02-08 19:49:48 +01:00
2023-01-10 19:32:31 +01:00
2022-12-06 08:54:33 +01:00
2023-01-28 22:41:36 +01:00
2023-03-04 21:34:54 -07:00
2023-02-13 00:50:07 +00:00
2022-12-06 08:54:33 +01:00
2023-02-13 00:50:07 +00:00
2023-02-13 00:50:07 +00:00
2023-02-25 20:51:49 +01:00
2023-01-11 20:54:49 +00:00
2023-03-05 08:38:29 +00:00
2023-03-05 08:38:29 +00:00
2023-02-13 00:50:07 +00:00
2023-02-13 00:50:07 +00:00
2023-02-13 00:50:07 +00:00
2023-02-13 00:50:07 +00:00
2023-02-13 00:50:07 +00:00
2022-12-06 08:54:33 +01:00
2023-01-12 11:25:51 +01:00
2023-01-12 11:25:51 +01:00
2022-12-20 10:45:20 +01:00
2022-12-20 10:45:20 +01:00
2023-03-03 15:23:47 +01:00
2023-03-03 15:23:47 +01:00