20#ifndef RIPPLE_PATH_IMPL_AMOUNTSPEC_H_INCLUDED
21#define RIPPLE_PATH_IMPL_AMOUNTSPEC_H_INCLUDED
23#include <xrpl/protocol/IOUAmount.h>
24#include <xrpl/protocol/STAmount.h>
25#include <xrpl/protocol/XRPAmount.h>
52 stream <<
"/(" << *amt.
currency <<
")";
54 stream <<
"/" << *amt.
issuer <<
"";
77#if defined(__GNUC__) && !defined(__clang__)
78#pragma GCC diagnostic push
80#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
88#if defined(__GNUC__) && !defined(__clang__)
89#pragma GCC diagnostic pop
120 static_assert(
sizeof(T) == -1,
"Must used specialized function");
129 !amt.
native,
"ripple::get<IOUAmount>(EitherAmount&) : is not XRP");
137 XRPL_ASSERT(amt.
native,
"ripple::get<XRPAmount>(EitherAmount&) : is XRP");
145 static_assert(
sizeof(T) == -1,
"Must used specialized function");
155 "ripple::get<IOUAmount>(EitherAmount const&) : is not XRP");
164 amt.
native,
"ripple::get<XRPAmount>(EitherAmount const&) : is XRP");
173 "ripple::toAmountSpec(STAmount const&) : maximum mantissa");
210 "ripple::toAmountSpec(EitherAmount const&&, std::optional<Currency>) : "
Floating point representation of amounts with high dynamic range.
int exponent() const noexcept
bool negative() const noexcept
Issue const & issue() const
std::uint64_t mantissa() 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)
XRPAmount & get< XRPAmount >(EitherAmount &amt)
AmountSpec toAmountSpec(STAmount const &amt)
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)
std::optional< Currency > currency
std::optional< AccountID > issuer
friend std::ostream & operator<<(std::ostream &stream, AmountSpec const &amt)
EitherAmount(XRPAmount const &a)
friend std::ostream & operator<<(std::ostream &stream, EitherAmount const &amt)
EitherAmount(IOUAmount const &a)
EitherAmount(AmountSpec const &a)