20 #include <ripple/basics/Log.h>
21 #include <ripple/basics/StringUtilities.h>
22 #include <ripple/basics/contract.h>
23 #include <ripple/basics/strHex.h>
24 #include <ripple/protocol/STPathSet.h>
25 #include <ripple/protocol/jss.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);
58 int iType = sit.
get8();
65 JLOG(
debugLog().error()) <<
"Empty path in pathset";
66 Throw<std::runtime_error>(
"empty path");
78 <<
"Bad path element " << iType <<
" in pathset";
79 Throw<std::runtime_error>(
"bad path element");
100 path.emplace_back(account, currency, issuer, hasCurrency);
108 value.push_back(base);
115 while (++it !=
value.rend())
139 for (
auto& p :
mPath)
141 if (p.getAccountID() == account && p.getCurrency() == currency &&
142 p.getIssuerID() == issuer)
153 for (
auto it :
mPath)
156 auto const iType = it.getNodeType();
158 elem[jss::type] = iType;
159 elem[jss::type_hex] =
strHex(iType);
162 elem[jss::account] =
to_string(it.getAccountID());
165 elem[jss::currency] =
to_string(it.getCurrency());
168 elem[jss::issuer] =
to_string(it.getIssuerID());
180 for (
auto it :
value)
181 ret.
append(it.getJson(options));
193 for (
auto const& spPath :
value)
198 for (
auto const& speElement : spPath)
200 int iType = speElement.getNodeType();
void push_back(STPathElement const &e)
static std::size_t get_hash(STPathElement const &element)
@ arrayValue
array value (ordered list)
std::vector< STPathElement > mPath
int add8(unsigned char i)
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.
int addBitString(base_uint< Bits, Tag > const &v)
std::vector< STPath > value
A type which can be exported to a well known binary format.
Json::Value getJson(JsonOptions) const override
std::string strHex(FwdIt begin, FwdIt end)
bool assembleAdd(STPath const &base, STPathElement const &tail)
void push_back(STPath const &e)