20 #include <ripple/basics/Log.h>
21 #include <ripple/basics/contract.h>
22 #include <ripple/protocol/STArray.h>
23 #include <ripple/protocol/STBase.h>
28 :
STBase(other.getFName()), v_(
std::move(other.v_))
36 v_ = std::move(other.v_);
67 <<
"Encountered array with end of object marker";
68 Throw<std::runtime_error>(
"Illegal terminator in array");
76 <<
"Unknown field: " << type <<
"/" << field;
77 Throw<std::runtime_error>(
"Unknown field");
82 JLOG(
debugLog().error()) <<
"Array contains non-object";
83 Throw<std::runtime_error>(
"Non-object in array");
88 v_.
back().applyTemplateFromSField(fn);
98 for (
auto const& obj :
v_)
103 r += obj.getFullText();
134 for (
auto const&
object :
v_)
139 inner[
object.getFName().getJsonName()] =
object.getJson(p);
150 object.addFieldID(s);
159 auto v =
dynamic_cast<const STArray*
>(&t);
160 return v !=
nullptr &&
v_ == v->v_;
int addFieldID(int type, int name)
@ arrayValue
array value (ordered list)
virtual bool isEquivalent(const STBase &t) const override
virtual Json::Value getJson(JsonOptions index) const override
void getFieldID(int &type, int &name)
static const SField & getField(int fieldCode)
beast::Journal debugLog()
Returns a debug journal.
Value & append(const Value &value)
Append value to array at the end.
@ objectValue
object value (collection of name/value pairs).
std::size_t empty() const noexcept
int compare(base_uint< Bits, Tag > const &a, base_uint< Bits, Tag > const &b)
STArray & operator=(STArray const &)=default
virtual SerializedTypeID getSType() const override
void setFName(SField const &n)
A STBase is a field.
virtual std::string getFullText() const override
void sort(bool(*compare)(const STObject &o1, const STObject &o2))
virtual std::string getText() const override
T emplace_back(T... args)
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
A type which can be exported to a well known binary format.
virtual void add(Serializer &s) const override