1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:27:35 +00:00

HackStudio: Add HackStudio::for_each_open_file

This commit is contained in:
Itamar 2021-12-03 09:38:03 +02:00 committed by Andreas Kling
parent 3a44b8111b
commit 3e9a96f1d8
4 changed files with 14 additions and 0 deletions

View file

@ -21,6 +21,7 @@ void open_file(const String&, size_t line, size_t column);
Project& project();
String currently_open_file();
void set_current_editor_wrapper(RefPtr<EditorWrapper>);
void for_each_open_file(Function<void(ProjectFile const&)>);
class Locator;
Locator& locator();

View file

@ -1484,4 +1484,11 @@ void HackStudioWidget::open_coredump(String const& coredump_path)
}
}
void HackStudioWidget::for_each_open_file(Function<void(ProjectFile const&)> func)
{
for (auto& open_file : m_open_files) {
func(*open_file.value);
}
}
}

View file

@ -69,6 +69,7 @@ public:
};
void open_coredump(String const& coredump_path);
void for_each_open_file(Function<void(ProjectFile const&)>);
private:
static String get_full_path_of_serenity_source(const String& file);

View file

@ -168,4 +168,9 @@ Locator& locator()
return s_hack_studio_widget->locator();
}
void for_each_open_file(Function<void(ProjectFile const&)> func)
{
s_hack_studio_widget->for_each_open_file(move(func));
}
}