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);
101 return emplace(n, buf, std::move(*
this));
110 for (
auto const& obj :
v_)
115 r += obj.getFullText();
146 for (
auto const&
object :
v_)
151 inner[
object.getFName().getJsonName()] =
object.getJson(p);
162 object.addFieldID(s);
177 auto v =
dynamic_cast<const STArray*
>(&t);
178 return v !=
nullptr &&
v_ == v->v_;
int addFieldID(int type, int name)
@ arrayValue
array value (ordered list)
bool isEquivalent(const STBase &t) const override
Json::Value getJson(JsonOptions index) const override
void getFieldID(int &type, int &name)
STBase * copy(std::size_t n, void *buf) const override
static const SField & getField(int fieldCode)
beast::Journal debugLog()
Returns a debug journal.
SerializedTypeID getSType() const override
Value & append(const Value &value)
Append value to array at the end.
@ objectValue
object value (collection of name/value pairs).
static STBase * emplace(std::size_t n, void *buf, T &&val)
std::size_t empty() const noexcept
bool isDefault() const override
STArray & operator=(STArray const &)=default
void setFName(SField const &n)
A STBase is a field.
std::string getFullText() const override
void sort(bool(*compare)(const STObject &o1, const STObject &o2))
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.
STBase * move(std::size_t n, void *buf) override
void add(Serializer &s) const override