3#include <xrpl/protocol/IOUAmount.h>
4#include <xrpl/protocol/STAmount.h>
5#include <xrpl/protocol/XRPAmount.h>
32 stream <<
"/(" << *amt.
currency <<
")";
34 stream <<
"/" << *amt.
issuer <<
"";
57#if defined(__GNUC__) && !defined(__clang__)
58#pragma GCC diagnostic push
60#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
68#if defined(__GNUC__) && !defined(__clang__)
69#pragma GCC diagnostic pop
100 static_assert(
sizeof(T) == -1,
"Must used specialized function");
108 XRPL_ASSERT(!amt.
native,
"xrpl::get<IOUAmount>(EitherAmount&) : is not XRP");
116 XRPL_ASSERT(amt.
native,
"xrpl::get<XRPAmount>(EitherAmount&) : is XRP");
124 static_assert(
sizeof(T) == -1,
"Must used specialized function");
132 XRPL_ASSERT(!amt.
native,
"xrpl::get<IOUAmount>(EitherAmount const&) : is not XRP");
140 XRPL_ASSERT(amt.
native,
"xrpl::get<XRPAmount>(EitherAmount const&) : is XRP");
149 "xrpl::toAmountSpec(STAmount const&) : maximum mantissa");
185 "xrpl::toAmountSpec(EitherAmount const&&, std::optional<Currency>) : "
Floating point representation of amounts with high dynamic range.
Issue const & issue() const
std::uint64_t mantissa() const noexcept
bool negative() const noexcept
int exponent() const noexcept
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
IOUAmount & get< IOUAmount >(EitherAmount &amt)
bool isXRP(AccountID const &c)
std::string to_string(base_uint< Bits, Tag > const &a)
T get(Section const §ion, std::string const &name, T const &defaultValue=T{})
Retrieve a key/value pair from a section.
EitherAmount toEitherAmount(STAmount const &amt)
XRPAmount & get< XRPAmount >(EitherAmount &amt)
AmountSpec toAmountSpec(STAmount const &amt)
std::optional< AccountID > issuer
friend std::ostream & operator<<(std::ostream &stream, AmountSpec const &amt)
std::optional< Currency > currency
EitherAmount(XRPAmount const &a)
friend std::ostream & operator<<(std::ostream &stream, EitherAmount const &amt)
EitherAmount(AmountSpec const &a)
EitherAmount(IOUAmount const &a)