|
DuxReiNummariae 1.1.0-alpha.19
Simple and powerful budgeting application
|
The manager for interacting with a budget file. More...
#include <BudgetFile.hpp>
Public Member Functions | |
| BudgetFile () | |
| BudgetFile (const QString &fileLocation, const QString &backUpExtension=BudgetFile::defaultBackUpExtension_) | |
| Initialises the entire object using the supplied values. | |
| const QString & | backUpExtension () const |
| The extension to use when backing-up a budget file. | |
| void | changeLocation (const ::QString &fileLocation) override |
| Changes the location of the budget file to load. | |
| const QString & | directoryPath () const |
| The absolute directory path of the budget file. | |
| storage::BudgetStorage::Data | load () const override |
| Loads the budget file from the local file-system. | |
| const QString & | name () const noexcept override |
| The file name of the budget file. | |
| void | store (const storage::BudgetStorage::Data &data) const override |
| Creates or overwrites the budget file to the local file-system. When overwriting the budget file, a back-up copy is created in the same directory. | |
| Public Member Functions inherited from drn::storage::BudgetStorage | |
| BudgetStorage ()=default | |
| BudgetStorage (BudgetStorage &&)=default | |
| BudgetStorage (const BudgetStorage &)=delete | |
| virtual | ~BudgetStorage ()=default |
| BudgetStorage & | operator= (BudgetStorage &&)=default |
| BudgetStorage & | operator= (const BudgetStorage &)=delete |
Static Public Attributes | |
| static const QChar | defaultBackUpExtension_ |
| static const QString | oldBackUpExtension_ |
| The extension used when backing-up a back-up to a budget file. | |
The manager for interacting with a budget file.
| drn::file_storage::BudgetFile::BudgetFile | ( | ) |
|
explicit |
Initialises the entire object using the supplied values.
| Error | When the supplied file location is empty. |
| Error | When the supplied file location is not absolute. |
| Error | When the supplied back-up extension starts with the full stop file separator ('.'). |
| fileLocation | The file name and absolute directory path of the budget file. The text after the last directory separator is assumed to be the name of the budget file. |
| backUpExtension | (Optional) The extension to use when backing-up a pre-existing budget file. When this is not the default, it must not start with the full stop. |
|
nodiscard |
The extension to use when backing-up a budget file.
|
overridevirtual |
Changes the location of the budget file to load.
| StorageError | When the location is invalid. |
| fileLocation | The directory path and file-name of the budget file to use. |
Implements drn::storage::BudgetStorage.
|
nodiscard |
The absolute directory path of the budget file.
|
nodiscardoverridevirtual |
Loads the budget file from the local file-system.
| StorageError | When the budget file cannot be found. |
Implements drn::storage::BudgetStorage.
|
nodiscardoverridevirtualnoexcept |
The file name of the budget file.
Implements drn::storage::BudgetStorage.
|
overridevirtual |
Creates or overwrites the budget file to the local file-system. When overwriting the budget file, a back-up copy is created in the same directory.
| StorageError | When the budget file cannot be saved. |
| StorageError | When the budget file cannot be backed-up prior to saving. |
| [in] | data | The budget data to store. |
Implements drn::storage::BudgetStorage.
|
static |
The default extension used when backing-up a budget file, on systems like KDE this will show a nice back-up icon.
|
static |
The extension used when backing-up a back-up to a budget file.