rippled
Loading...
Searching...
No Matches
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...

#include <amount.h>

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
 
template<class T >
 PrettyAmount (T v, std::enable_if_t< sizeof(T) >=sizeof(int) &&std::is_unsigned_v< T > > *=nullptr)
 drops
 
 PrettyAmount (XRPAmount v)
 drops
 
std::string const & name () const
 
STAmount const & value () const
 
Number number () const
 
int signum () const
 
 operator STAmount const & () const
 
 operator AnyAmount () const
 
 operator Json::Value () 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 64 of file src/test/jtx/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 77 of file src/test/jtx/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 84 of file src/test/jtx/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 95 of file src/test/jtx/amount.h.

◆ PrettyAmount() [6/6]

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

drops

Definition at line 104 of file src/test/jtx/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 109 of file src/test/jtx/amount.h.

◆ value()

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

Definition at line 115 of file src/test/jtx/amount.h.

◆ number()

Number ripple::test::jtx::PrettyAmount::number ( ) const

Definition at line 121 of file src/test/jtx/amount.h.

◆ signum()

int ripple::test::jtx::PrettyAmount::signum ( ) const

Definition at line 127 of file src/test/jtx/amount.h.

◆ operator STAmount const &()

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

Definition at line 132 of file src/test/jtx/amount.h.

◆ operator AnyAmount()

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

Definition at line 31 of file amount.cpp.

◆ operator Json::Value()

ripple::test::jtx::PrettyAmount::operator Json::Value ( ) const

Definition at line 139 of file src/test/jtx/amount.h.

Member Data Documentation

◆ amount_

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

Definition at line 68 of file src/test/jtx/amount.h.

◆ name_

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

Definition at line 69 of file src/test/jtx/amount.h.