DuxReiNummariae 1.0.0-alpha.23
Simple and powerful budgeting application
 
Loading...
Searching...
No Matches
drn::file_storage::ExchangeRatesFile Class Referencefinal

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.h>

Inheritance diagram for drn::file_storage::ExchangeRatesFile:
Collaboration diagram for drn::file_storage::ExchangeRatesFile:

Public Member Functions

bool exists () const noexcept override
 Determines if the exchange rates file exists.
 
drn::conversion::ConversionMap load () const override
 Loads the exchange rates file.
 
void remove () const override
 Removes the cached exchange rate file.
 
void store (const drn::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 &)=default
 
 ExchangeRatesStorage (ExchangeRatesStorage &&)=default
 
virtual ~ExchangeRatesStorage ()=default
 
ExchangeRatesStorageoperator= (const ExchangeRatesStorage &)=default
 
ExchangeRatesStorageoperator= (ExchangeRatesStorage &&)=default
 

Detailed Description

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".

Member Function Documentation

◆ exists()

bool drn::file_storage::ExchangeRatesFile::exists ( ) const
overridevirtualnoexcept

Determines if the exchange rates file exists.

Returns
True when the cached path exists and is a file, false else-wise.

Implements drn::storage::ExchangeRatesStorage.

◆ load()

drn::conversion::ConversionMap drn::file_storage::ExchangeRatesFile::load ( ) const
overridevirtual

Loads the exchange rates file.

Exceptions
BinaryFileErrorWhen the exchange rates file is not valid.
Returns
The loaded exchange rates.

Implements drn::storage::ExchangeRatesStorage.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ remove()

void drn::file_storage::ExchangeRatesFile::remove ( ) const
overridevirtual

Removes the cached exchange rate file.

Implements drn::storage::ExchangeRatesStorage.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ store()

void drn::file_storage::ExchangeRatesFile::store ( const drn::conversion::ConversionMap & cm) const
overridevirtual

Creates or overwrites the exchange rates file.

Exceptions
BinaryFileErrorWhen the exchange rates file cannot be saved.
Parameters
[in]cmThe exchange rates whose contents are to be stored in the file.

Implements drn::storage::ExchangeRatesStorage.

Here is the call graph for this function:
Here is the caller graph for this function: