A three-letter currency code, such as KRW or USD (ISO 4217 style).
More...
#include <algotradelib/src/core/types.hpp>
|
| | Currency () |
| | Constructs Korean won.
|
| | Currency (std::string_view code) |
| | Constructs a currency from its code.
|
| std::string | str () const |
| | Returns the code.
|
A three-letter currency code, such as KRW or USD (ISO 4217 style).
Definition at line 234 of file types.hpp.
◆ Currency() [1/2]
| algotradelib::Currency::Currency |
( |
| ) |
|
|
inline |
◆ Currency() [2/2]
| algotradelib::Currency::Currency |
( |
std::string_view | code | ) |
|
|
inlineexplicit |
Constructs a currency from its code.
- Parameters
-
| code | Three uppercase ASCII letters. |
- Exceptions
-
| std::invalid_argument | if code is not three uppercase ASCII letters. |
Definition at line 245 of file types.hpp.
◆ krw()
| Currency algotradelib::Currency::krw |
( |
| ) |
|
|
inlinestatic |
Returns Korean won.
- Returns
- KRW.
Definition at line 262 of file types.hpp.
◆ str()
| std::string algotradelib::Currency::str |
( |
| ) |
const |
|
inline |
Returns the code.
- Returns
- The three letters.
Definition at line 274 of file types.hpp.
◆ usd()
| Currency algotradelib::Currency::usd |
( |
| ) |
|
|
inlinestatic |
Returns United States dollars.
- Returns
- USD.
Definition at line 268 of file types.hpp.
◆ operator==
Compares two currencies.
- Parameters
-
| lhs | The first currency. |
| rhs | The second currency. |
- Returns
- true if the codes are equal.
Definition at line 282 of file types.hpp.
The documentation for this class was generated from the following file: