mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:57:35 +00:00
HackStudio: Add HackStudio::for_each_open_file
This commit is contained in:
parent
3a44b8111b
commit
3e9a96f1d8
4 changed files with 14 additions and 0 deletions
|
@ -21,6 +21,7 @@ void open_file(const String&, size_t line, size_t column);
|
||||||
Project& project();
|
Project& project();
|
||||||
String currently_open_file();
|
String currently_open_file();
|
||||||
void set_current_editor_wrapper(RefPtr<EditorWrapper>);
|
void set_current_editor_wrapper(RefPtr<EditorWrapper>);
|
||||||
|
void for_each_open_file(Function<void(ProjectFile const&)>);
|
||||||
|
|
||||||
class Locator;
|
class Locator;
|
||||||
Locator& locator();
|
Locator& locator();
|
||||||
|
|
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,6 +69,7 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
void open_coredump(String const& coredump_path);
|
void open_coredump(String const& coredump_path);
|
||||||
|
void for_each_open_file(Function<void(ProjectFile const&)>);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static String get_full_path_of_serenity_source(const String& file);
|
static String get_full_path_of_serenity_source(const String& file);
|
||||||
|
|
|
@ -168,4 +168,9 @@ Locator& locator()
|
||||||
return s_hack_studio_widget->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));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue