1 #ifndef VTESTBED_GUI_FILEDIALOG_HH 2 #define VTESTBED_GUI_FILEDIALOG_HH 6 #include <unordered_set> 8 #include <Corrade/Utility/Directory.h> 17 typedef Corrade::Utility::Directory::Flag Flag;
18 typedef Corrade::Containers::EnumSet<Flag> FlagSet;
24 using path_type = std::filesystem::path;
27 FlagSet _flags = Flag::SkipDirectories | Flag::SkipSpecial |
28 Flag::SkipDotAndDotDot | Flag::SortAscending;
34 State _state = State::Listing;
35 int _selected_index = -1;
36 bool _visible =
false;
37 bool _breadcrumbs =
true;
50 this->_buttonText = rhs;
55 this->_state = State::Error;
56 this->_errorText = message;
61 this->_extensions.clear();
62 this->_extensions.insert(rhs.begin(), rhs.end());
72 return this->_visible;
77 return !this->_visible;
81 hasSelectedFile()
const {
82 return this->_selected_index != -1;
86 selectedFile()
const {
87 return this->_files[this->_selected_index];
96 void directory(
const path_type& rhs);
97 void next_directory(
const path_type& rhs);
105 #endif // vim:filetype=cpp