Manages the details of fetching conversion rates between two currencies from the Open Exchange Rates, https://openexchangerates.org/ .
More...
#include <OpenExchangeRatesSource.hpp>
|
| static constexpr auto | host_ {"openexchangerates.org"} |
Manages the details of fetching conversion rates between two currencies from the Open Exchange Rates, https://openexchangerates.org/ .
◆ OpenExchangeRatesSource()
Full initialisation constructor.
- Parameters
-
| sender | The object through which the network is accessible for sending requests. |
| appId | The application identifier for the OER servers. |
| parent | The parent widget of the object. |
◆ ~OpenExchangeRatesSource()
| drn::conversion::OpenExchangeRatesSource::~OpenExchangeRatesSource |
( |
| ) |
|
|
override |
◆ applicationId()
| const QString & drn::conversion::OpenExchangeRatesSource::applicationId |
( |
| ) |
const |
|
nodiscard |
The application identifier for the OER servers.
◆ fetch()
| pecunia::FloatingPoint drn::conversion::OpenExchangeRatesSource::fetch |
( |
const pecunia::Currency & | from, |
|
|
const pecunia::Currency & | to ) const |
|
nodiscardoverridevirtual |
Synchronously retrieves the conversion from one currency code to another.
- Exceptions
-
| ReplyError | When it fails to during the reply of a conversion request. |
| ParsingError | When the data returned contains an error. |
- Parameters
-
| from | The currency to convert from. |
| to | The currency to convert to. |
- Returns
- The ratio that when multiplied will take the value of "from" to the value of "to".
Implements drn::conversion::CurrencySource.
◆ host_
| auto drn::conversion::OpenExchangeRatesSource::host_ {"openexchangerates.org"} |
|
staticconstexpr |