rippled
Public Member Functions | Private Attributes | List of all members
ripple::test::jtx::PrettyAmount Struct Reference

Represents an XRP or IOU quantity This customizes the string conversion and supports XRP conversions from integer and floating point. More...

Collaboration diagram for ripple::test::jtx::PrettyAmount:
Collaboration graph
[legend]

Public Member Functions

 PrettyAmount ()=default
 
 PrettyAmount (PrettyAmount const &)=default
 
PrettyAmountoperator= (PrettyAmount const &)=default
 
 PrettyAmount (STAmount const &amount, std::string const &name)
 
template<class T >
 PrettyAmount (T v, std::enable_if_t< sizeof(T) >=sizeof(int) &&std::is_integral_v< T > &&std::is_signed_v< T >> *=nullptr)
 drops More...
 
template<class T >
 PrettyAmount (T v, std::enable_if_t< sizeof(T) >=sizeof(int) &&std::is_unsigned_v< T >> *=nullptr)
 drops More...
 
 PrettyAmount (XRPAmount v)
 drops More...
 
std::string const & name () const
 
STAmount const & value () const
 
 operator STAmount const & () const
 
 operator AnyAmount () const
 

Private Attributes

STAmount amount_
 
std::string name_
 

Detailed Description

Represents an XRP or IOU quantity This customizes the string conversion and supports XRP conversions from integer and floating point.

Definition at line 73 of file amount.h.

Constructor & Destructor Documentation

◆ PrettyAmount() [1/6]

ripple::test::jtx::PrettyAmount::PrettyAmount ( )
default

◆ PrettyAmount() [2/6]

ripple::test::jtx::PrettyAmount::PrettyAmount ( PrettyAmount const &  )
default

◆ PrettyAmount() [3/6]

ripple::test::jtx::PrettyAmount::PrettyAmount ( STAmount const &  amount,
std::string const &  name 
)

Definition at line 86 of file amount.h.

◆ PrettyAmount() [4/6]

template<class T >
ripple::test::jtx::PrettyAmount::PrettyAmount ( v,
std::enable_if_t< sizeof(T) >  = sizeof(int) && std::is_integral_v<T> && std::is_signed_v<T>,
= nullptr 
)

drops

Definition at line 93 of file amount.h.

◆ PrettyAmount() [5/6]

template<class T >
ripple::test::jtx::PrettyAmount::PrettyAmount ( v,
std::enable_if_t< sizeof(T) >  = sizeof(int) && std::is_unsigned_v<T>,
= nullptr 
)

drops

Definition at line 104 of file amount.h.

◆ PrettyAmount() [6/6]

ripple::test::jtx::PrettyAmount::PrettyAmount ( XRPAmount  v)

drops

Definition at line 113 of file amount.h.

Member Function Documentation

◆ operator=()

PrettyAmount& ripple::test::jtx::PrettyAmount::operator= ( PrettyAmount const &  )
default

◆ name()

std::string const& ripple::test::jtx::PrettyAmount::name ( ) const

Definition at line 118 of file amount.h.

◆ value()

STAmount const& ripple::test::jtx::PrettyAmount::value ( ) const

Definition at line 124 of file amount.h.

◆ operator STAmount const &()

ripple::test::jtx::PrettyAmount::operator STAmount const & ( ) const

Definition at line 129 of file amount.h.

◆ operator AnyAmount()

ripple::test::jtx::PrettyAmount::operator AnyAmount ( ) const

Definition at line 50 of file amount.cpp.

Member Data Documentation

◆ amount_

STAmount ripple::test::jtx::PrettyAmount::amount_
private

Definition at line 77 of file amount.h.

◆ name_

std::string ripple::test::jtx::PrettyAmount::name_
private

Definition at line 78 of file amount.h.