summaryrefslogtreecommitdiff
path: root/Meta/Lagom/Tools
diff options
context:
space:
mode:
Diffstat (limited to 'Meta/Lagom/Tools')
-rw-r--r--Meta/Lagom/Tools/CodeGenerators/LibUnicode/GenerateEmojiData.cpp17
1 files changed, 7 insertions, 10 deletions
diff --git a/Meta/Lagom/Tools/CodeGenerators/LibUnicode/GenerateEmojiData.cpp b/Meta/Lagom/Tools/CodeGenerators/LibUnicode/GenerateEmojiData.cpp
index 66b79d15d4..09a3dab1c0 100644
--- a/Meta/Lagom/Tools/CodeGenerators/LibUnicode/GenerateEmojiData.cpp
+++ b/Meta/Lagom/Tools/CodeGenerators/LibUnicode/GenerateEmojiData.cpp
@@ -13,7 +13,6 @@
#include <AK/Types.h>
#include <LibCore/ArgsParser.h>
#include <LibCore/DeprecatedFile.h>
-#include <LibCore/DirIterator.h>
#include <LibCore/Directory.h>
#include <LibUnicode/Emoji.h>
@@ -171,14 +170,10 @@ static ErrorOr<void> parse_emoji_serenity_data(Core::BufferedFile& file, EmojiDa
static ErrorOr<void> validate_emoji(StringView emoji_resource_path, EmojiData& emoji_data)
{
- Core::DirIterator iterator(emoji_resource_path, Core::DirIterator::SkipDots);
-
- while (iterator.has_next()) {
- auto filename = iterator.next_path();
-
- auto lexical_path = LexicalPath(filename);
+ TRY(Core::Directory::for_each_entry(emoji_resource_path, Core::DirIterator::SkipDots, [&](auto& entry, auto&) -> ErrorOr<IterationDecision> {
+ auto lexical_path = LexicalPath(entry.name);
if (lexical_path.extension() != "png")
- continue;
+ return IterationDecision::Continue;
auto title = lexical_path.title();
if (!title.starts_with("U+"sv))
@@ -198,10 +193,12 @@ static ErrorOr<void> validate_emoji(StringView emoji_resource_path, EmojiData& e
});
if (it == emoji_data.emojis.end()) {
- warnln("\x1b[1;31mError!\x1b[0m Emoji data for \x1b[35m{}\x1b[0m not found. Please check emoji-test.txt and emoji-serenity.txt.", filename);
+ warnln("\x1b[1;31mError!\x1b[0m Emoji data for \x1b[35m{}\x1b[0m not found. Please check emoji-test.txt and emoji-serenity.txt.", entry.name);
return Error::from_errno(ENOENT);
}
- }
+
+ return IterationDecision::Continue;
+ }));
return {};
}