|
DuxReiNummariae 1.1.0-alpha.19
Simple and powerful budgeting application
|
The manager for interacting with the cached exchange rates file. This is stored under the operating systems' cache directory with the name "exchange-rates.dat". More...
#include <ExchangeRatesFile.hpp>
Public Member Functions | |
| ExchangeRatesFile (const std::optional< std::filesystem::path > &filePath=std::nullopt) | |
| Full initialisation constructor. | |
| bool | exists () const noexcept override |
| Determines if the exchange rates file exists. | |
| std::filesystem::path | filePathName () const |
| Retrieves the file path and name of the exchange rates file stored on the system. | |
| conversion::ConversionMap | load () const override |
| Loads the exchange rates file. | |
| void | remove () const override |
| Removes the cached exchange rate file. | |
| void | store (const conversion::ConversionMap &cm) const override |
| Creates or overwrites the exchange rates file. | |
| Public Member Functions inherited from drn::storage::ExchangeRatesStorage | |
| ExchangeRatesStorage ()=default | |
| ExchangeRatesStorage (const ExchangeRatesStorage &)=delete | |
| ExchangeRatesStorage (ExchangeRatesStorage &&)=default | |
| virtual | ~ExchangeRatesStorage ()=default |
| ExchangeRatesStorage & | operator= (const ExchangeRatesStorage &)=delete |
| ExchangeRatesStorage & | operator= (ExchangeRatesStorage &&)=default |
The manager for interacting with the cached exchange rates file. This is stored under the operating systems' cache directory with the name "exchange-rates.dat".
|
explicit |
Full initialisation constructor.
| [in] | filePath | The optional file path to set as the location for the exchange rates file. If omitted, a default path derived from the operating system's cache location is used. |
|
nodiscardoverridevirtualnoexcept |
Determines if the exchange rates file exists.
Implements drn::storage::ExchangeRatesStorage.
|
nodiscard |
Retrieves the file path and name of the exchange rates file stored on the system.
|
nodiscardoverridevirtual |
Loads the exchange rates file.
| BinaryFileError | When the exchange rates file is not valid. |
Implements drn::storage::ExchangeRatesStorage.
|
overridevirtual |
Removes the cached exchange rate file.
Implements drn::storage::ExchangeRatesStorage.
|
overridevirtual |
Creates or overwrites the exchange rates file.
| BinaryFileError | When the exchange rates file cannot be saved. |
| [in] | cm | The exchange rates whose contents are to be stored in the file. |
Implements drn::storage::ExchangeRatesStorage.