20 #include <ripple/beast/utility/Zero.h>
21 #include <ripple/protocol/Serializer.h>
22 #include <ripple/protocol/SystemParameters.h>
23 #include <ripple/protocol/UintTypes.h>
36 "abcdefghijklmnopqrstuvwxyz"
37 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
52 if (currency == beast::zero)
58 static Currency const sIsoBits = []() {
60 (void)c.
parseHex(
"FFFFFFFFFFFFFFFFFFFFFFFF000000FFFFFFFFFF");
64 if ((currency & sIsoBits).isZero())
87 currency = beast::zero;
97 currency = beast::zero;
104 return static_cast<unsigned char>(
105 ::toupper(static_cast<unsigned char>(c)));
126 static Currency const currency(beast::zero);
140 static Currency const currency(0x5852500000000000);
Currency const & badCurrency()
We deliberately disallow the currency that looks like "XRP" because too many people were using it ins...
static std::string const & systemCurrencyCode()
bool to_currency(Currency ¤cy, std::string const &code)
Tries to convert a string to a Currency, returns true on success.
Currency const & noCurrency()
A placeholder for empty currencies.
constexpr std::size_t isoCodeLength
std::string to_string(ListDisposition disposition)
T find_first_not_of(T... args)
constexpr std::size_t isoCodeOffset
base_uint< 160, detail::CurrencyTag > Currency
Currency is a hash representing a specific currency.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
bool parseHex(std::string_view sv)
Parse a hex string into a base_uint.
constexpr std::string_view isoCharSet
std::string strHex(FwdIt begin, FwdIt end)
Currency const & xrpCurrency()
XRP currency.