Improve the readability of STBase-derived types

* Increase the visibility of each type's API.
* No functional changes.
This commit is contained in:
Howard Hinnant
2021-10-07 16:12:31 -04:00
committed by Nik Bougalis
parent 72377e7bf2
commit 74e6ed1af3
24 changed files with 2145 additions and 1425 deletions

View File

@@ -27,12 +27,40 @@ STBlob::STBlob(SerialIter& st, SField const& name)
{
}
STBase*
STBlob::copy(std::size_t n, void* buf) const
{
return emplace(n, buf, *this);
}
STBase*
STBlob::move(std::size_t n, void* buf)
{
return emplace(n, buf, std::move(*this));
}
SerializedTypeID
STBlob::getSType() const
{
return STI_VL;
}
std::string
STBlob::getText() const
{
return strHex(value_);
}
void
STBlob::add(Serializer& s) const
{
assert(getFName().isBinary());
assert(
(getFName().fieldType == STI_VL) ||
(getFName().fieldType == STI_ACCOUNT));
s.addVL(value_.data(), value_.size());
}
bool
STBlob::isEquivalent(const STBase& t) const
{
@@ -40,4 +68,10 @@ STBlob::isEquivalent(const STBase& t) const
return v && (value_ == v->value_);
}
bool
STBlob::isDefault() const
{
return value_.empty();
}
} // namespace ripple