20 #include <ripple/protocol/STCurrency.h>
21 #include <ripple/protocol/jss.h>
23 #include <ripple/basics/contract.h>
33 currency_ = sit.get160();
37 :
STBase{name}, currency_{currency}
68 return v && (*v == *
this);
80 return std::make_unique<STCurrency>(sit, name);
92 return emplace(n, buf, std::move(*
this));
100 Throw<std::runtime_error>(
101 "currencyFromJson currency must be a string Json value");
107 Throw<std::runtime_error>(
108 "currencyFromJson currency must be a valid currency");
Currency const & badCurrency()
We deliberately disallow the currency that looks like "XRP" because too many people were using it ins...
bool to_currency(Currency ¤cy, std::string const &code)
Tries to convert a string to a Currency, returns true on success.
Currency const & noCurrency()
A placeholder for empty currencies.
void add(Serializer &s) const override
bool isEquivalent(const STBase &t) const override
STCurrency currencyFromJson(SField const &name, Json::Value const &v)
bool isDefault() const override
std::string getText() const override
static STBase * emplace(std::size_t n, void *buf, T &&val)
static std::unique_ptr< STCurrency > construct(SerialIter &, SField const &name)
STBase * move(std::size_t n, void *buf) override
bool isXRP(AccountID const &c)
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
int addBitString(base_uint< Bits, Tag > const &v)
Note, should be treated as flags that can be | and &.
A type which can be exported to a well known binary format.
SerializedTypeID getSType() const override
STBase * copy(std::size_t n, void *buf) const override
std::string to_string(Manifest const &m)
Format the specified manifest to a string for debugging purposes.
Json::Value getJson(JsonOptions) const override
std::string asString() const
Returns the unquoted string value.