|
EchoMap 2026-07-25 6d3977c
An experimental cross-platform digital signal processing application for sound-source localisation.
|
Provides a platform-independent Dear ImGui combo box for browsing the file-system and selecting files. More...
#include <FilesystemCombo.hpp>
Classes | |
| struct | Entry |
| A drawable and selectable representation of a file or directory on the file-system. More... | |
| struct | BrowseTarget |
| A root target selected by the user to focus on. More... | |
| struct | EntryCache |
| A cache of Entry objects under a single root directory. More... | |
Public Member Functions | |
| FilesystemCombo (EchoMap *app) | |
| Sets up a new FilesystemCombo with the given EchoMap application context. | |
| bool | operator() (std::filesystem::path &selected_path) |
| Draws the FilesystemCombo control. | |
Private Member Functions | |
| void | invalidate_cache () |
| Invalidates the EntryCache. | |
| void | update_current_state (const std::filesystem::path &path) |
| Copies and formats the given path into the fixed-size current directory state member variable. | |
| bool | draw_combo_body (std::filesystem::path &selected_path) |
| BrowseTarget | get_browse_target () const |
| bool | draw_parent_entry (const std::filesystem::path &directory) |
| bool | draw_child_entries (std::string_view filter, std::filesystem::path &selected_path) |
| void | accept_path (std::filesystem::path &selected_path, const std::filesystem::path &path) |
Private Attributes | |
| std::array< char, max_path_length > | current_root {} |
| The current raw string entered by the user. | |
| BrowseTarget | current_target |
| The current target specified in the filter window. | |
| std::optional< EntryCache > | cache |
| Cache of entries visible in the combo box. | |
| EchoMap * | app |
| Pointer to the owning application instance. | |
Static Private Attributes | |
| static constexpr unsigned int | max_path_length = 4096 |
| Maximum number of characters in a filesystem path. | |
Provides a platform-independent Dear ImGui combo box for browsing the file-system and selecting files.
Definition at line 31 of file FilesystemCombo.hpp.
|
explicit |
Sets up a new FilesystemCombo with the given EchoMap application context.
The initial location is the current working directory.
| app | The owning application instance. |
| std::runtime_error | The CWD could not be interrogated. |
Definition at line 24 of file FilesystemCombo.cpp.
|
private |
Definition at line 266 of file FilesystemCombo.cpp.
|
private |
Definition at line 227 of file FilesystemCombo.cpp.
|
private |
Definition at line 136 of file FilesystemCombo.cpp.
|
private |
Definition at line 210 of file FilesystemCombo.cpp.
|
nodiscardprivate |
Definition at line 177 of file FilesystemCombo.cpp.
|
private |
Invalidates the EntryCache.
Definition at line 81 of file FilesystemCombo.cpp.
| bool echomap::FilesystemCombo::operator() | ( | std::filesystem::path & | selected_path | ) |
Draws the FilesystemCombo control.
| selected_path | Output parameter for the selected file. |
Definition at line 38 of file FilesystemCombo.cpp.
|
private |
Copies and formats the given path into the fixed-size current directory state member variable.
The current directory array is always NULL-terminated following this operation. The current BrowseTarget is also updated to the given path.
| path | The path to the new root directory. |
Definition at line 123 of file FilesystemCombo.cpp.
|
private |
Pointer to the owning application instance.
Definition at line 186 of file FilesystemCombo.hpp.
|
private |
Cache of entries visible in the combo box.
Definition at line 185 of file FilesystemCombo.hpp.
|
private |
The current raw string entered by the user.
Definition at line 183 of file FilesystemCombo.hpp.
|
private |
The current target specified in the filter window.
Definition at line 184 of file FilesystemCombo.hpp.
|
staticconstexprprivate |
Maximum number of characters in a filesystem path.
Definition at line 55 of file FilesystemCombo.hpp.