|
|
Donner SVG Editor & Engine
SVG-native editor and embeddable SVG2 + CSS3 engine in C++20, with GPU (WebGPU) and compact CPU renderers, built for correctness, security, and performance.
|
Tracks the directory the user last browsed to and the most-recently opened/saved files, so the next dialog can seed a sensible starting directory and (on platforms without an OS recents list) an in-editor recent-files menu. More...
#include "donner/editor/FileDialogState.h"
Public Member Functions | |
| FileDialogState (std::size_t maxRecents=10) | |
| std::optional< std::string > | defaultDirectory (const std::optional< std::string > ¤tFilePath) const |
| Directory to seed the next dialog with. | |
| void | noteChosenPath (std::string_view path) |
Record that the user opened or saved path. Updates the remembered directory and pushes the file to the front of the recents list (de-duplicated, most-recent first, bounded by maxRecents). | |
| const std::vector< std::string > & | recentFiles () const |
| Most-recently opened/saved files, newest first. | |
| const std::optional< std::string > & | lastDirectory () const |
| Directory remembered from the last chosen file, if any. | |
Tracks the directory the user last browsed to and the most-recently opened/saved files, so the next dialog can seed a sensible starting directory and (on platforms without an OS recents list) an in-editor recent-files menu.
|
explicit |
| maxRecents | Maximum number of remembered recent files. |
|
nodiscard |
Directory to seed the next dialog with.
Preference order: the directory of the last chosen file, then the parent directory of currentFilePath if one is open, then empty (let the OS pick its own default).
| currentFilePath | Path of the document currently open, if any. |
| void donner::editor::FileDialogState::noteChosenPath | ( | std::string_view | path | ) |
Record that the user opened or saved path. Updates the remembered directory and pushes the file to the front of the recents list (de-duplicated, most-recent first, bounded by maxRecents).
Empty paths are ignored.