20 #include <ripple/protocol/STPathSet.h>
21 #include <ripple/protocol/jss.h>
22 #include <ripple/basics/contract.h>
23 #include <ripple/basics/Log.h>
24 #include <ripple/basics/strHex.h>
25 #include <ripple/basics/StringUtilities.h>
42 hash_account += (hash_account * 257) ^ x;
45 hash_currency += (hash_currency * 509) ^ x;
48 hash_issuer += (hash_issuer * 911) ^ x;
50 return (hash_account ^ hash_currency ^ hash_issuer);
59 int iType = sit.
get8 ();
67 <<
"Empty path in pathset";
68 Throw<std::runtime_error> (
"empty path");
80 <<
"Bad path element " << iType <<
" in pathset";
81 Throw<std::runtime_error> (
"bad path element");
102 path.emplace_back (account, currency, issuer, hasCurrency);
110 value.push_back (base);
117 while (++it !=
value.rend ())
142 if (p.getAccountID () == account
143 && p.getCurrency () == currency
144 && p.getIssuerID () == issuer)
159 auto const iType = it.getNodeType ();
161 elem[jss::type] = iType;
162 elem[jss::type_hex] =
strHex (iType);
165 elem[jss::account] =
to_string (it.getAccountID ());
168 elem[jss::currency] =
to_string (it.getCurrency ());
171 elem[jss::issuer] =
to_string (it.getIssuerID ());
184 ret.
append (it.getJson (options));
196 for (
auto const& spPath :
value)
201 for (
auto const& speElement : spPath)
203 int iType = speElement.getNodeType ();
208 s.
add160 (speElement.getAccountID ());
211 s.
add160 (speElement.getCurrency ());
214 s.
add160 (speElement.getIssuerID ());
void push_back(STPathElement const &e)
int add8(unsigned char byte)
static std::size_t get_hash(STPathElement const &element)
@ arrayValue
array value (ordered list)
std::vector< STPathElement > mPath
Currency const & getCurrency() const
std::string to_string(ListDisposition disposition)
beast::Journal debugLog()
Returns a debug journal.
bool isEquivalent(const STBase &t) const override
const SerializedTypeID fieldType
Value & append(const Value &value)
Append value to array at the end.
@ objectValue
object value (collection of name/value pairs).
AccountID const & getIssuerID() const
void add(Serializer &s) const override
AccountID const & getAccountID() const
Json::Value getJson(JsonOptions) const
bool hasSeen(AccountID const &account, Currency const ¤cy, AccountID const &issuer) const
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
std::vector< STPath > value
A type which can be exported to a well known binary format.
Json::Value getJson(JsonOptions) const override
int add160(base_uint< 160, Tag > const &i)
std::string strHex(FwdIt begin, FwdIt end)
bool assembleAdd(STPath const &base, STPathElement const &tail)
void push_back(STPath const &e)