1#ifndef XRPL_PATH_IMPL_AMOUNTSPEC_H_INCLUDED
2#define XRPL_PATH_IMPL_AMOUNTSPEC_H_INCLUDED
4#include <xrpl/protocol/IOUAmount.h>
5#include <xrpl/protocol/STAmount.h>
6#include <xrpl/protocol/XRPAmount.h>
33 stream <<
"/(" << *amt.
currency <<
")";
35 stream <<
"/" << *amt.
issuer <<
"";
58#if defined(__GNUC__) && !defined(__clang__)
59#pragma GCC diagnostic push
61#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
69#if defined(__GNUC__) && !defined(__clang__)
70#pragma GCC diagnostic pop
101 static_assert(
sizeof(T) == -1,
"Must used specialized function");
110 !amt.
native,
"ripple::get<IOUAmount>(EitherAmount&) : is not XRP");
118 XRPL_ASSERT(amt.
native,
"ripple::get<XRPAmount>(EitherAmount&) : is XRP");
126 static_assert(
sizeof(T) == -1,
"Must used specialized function");
136 "ripple::get<IOUAmount>(EitherAmount const&) : is not XRP");
145 amt.
native,
"ripple::get<XRPAmount>(EitherAmount const&) : is XRP");
154 "ripple::toAmountSpec(STAmount const&) : maximum mantissa");
191 "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)