The AbstractFileManager class is a base class providing simple read and write file access to database and saved game files.
More...
#include <abstract_file_manager.h>
|
| AbstractFileManager (const QString &folder_path_key) |
|
bool | close (const bool show_confirmation_dialog=true) |
| Closes the active database/saved game and clears all tables.
|
|
virtual QString | descriptor () const =0 |
| Returns the file manager descriptor. E.g. This will return "database" for a database file manager.
|
|
virtual QString | fileFilterString () const =0 |
| Returns a list of supported file type filters for QFileDialog .
|
|
bool | open (const QString &path) |
| Opens the file at path .
|
|
bool | open (QWidget *parent=nullptr) |
| Displays a file dialog window and opens the user selected file.
|
|
bool | save () |
| Saves the data to the existing file.
|
|
bool | saveAs (QWidget *parent=nullptr) |
| Displays a file dialog window and saves the user selected destination.
|
|
bool | isOpen () const |
| Returns whether or not a file is presently open.
|
|
bool | isSaved () const |
| Returns whether or not the file has been previously saved.
|
|
|
void | setOpenStatus (const bool is_open) |
|
void | setSaveStatus (const bool has_been_saved) |
|
The AbstractFileManager class is a base class providing simple read and write file access to database and saved game files.
◆ close()
bool ehm_dal::file_io::AbstractFileManager::close |
( |
const bool |
show_confirmation_dialog = true | ) |
|
Closes the active database/saved game and clears all tables.
- Parameters
-
show_confirmation_dialog | indicates whether or not to display a dialog asking the user to confirm |
- Returns
- whether or not successful
◆ descriptor()
virtual QString ehm_dal::file_io::AbstractFileManager::descriptor |
( |
| ) |
const |
|
pure virtual |
◆ fileFilterString()
virtual QString ehm_dal::file_io::AbstractFileManager::fileFilterString |
( |
| ) |
const |
|
pure virtual |
◆ open() [1/2]
bool ehm_dal::file_io::AbstractFileManager::open |
( |
const QString & |
path | ) |
|
Opens the file at path
.
- Parameters
-
- Returns
- whether or not successful
◆ open() [2/2]
bool ehm_dal::file_io::AbstractFileManager::open |
( |
QWidget * |
parent = nullptr | ) |
|
Displays a file dialog window and opens the user selected file.
- Parameters
-
parent | parent widget for the dialog window |
- Returns
- whether or not successful
◆ save()
bool ehm_dal::file_io::AbstractFileManager::save |
( |
| ) |
|
Saves the data to the existing file.
- Returns
- whether or not successful
◆ saveAs()
bool ehm_dal::file_io::AbstractFileManager::saveAs |
( |
QWidget * |
parent = nullptr | ) |
|
Displays a file dialog window and saves the user selected destination.
- Parameters
-
parent | parent widget for the dialog window |
- Returns
- whether or not successful