mirror of
https://github.com/XRPLF/rippled.git
synced 2026-04-29 15:37:57 +00:00
remove STInt64 (#5815)
This commit is contained in:
@@ -278,53 +278,4 @@ STInt32::getJson(JsonOptions) const
|
||||
return value_;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
template <>
|
||||
STInteger<std::int64_t>::STInteger(SerialIter& sit, SField const& name)
|
||||
: STInteger(name, sit.get64())
|
||||
{
|
||||
}
|
||||
|
||||
template <>
|
||||
SerializedTypeID
|
||||
STInt64::getSType() const
|
||||
{
|
||||
return STI_INT64;
|
||||
}
|
||||
|
||||
template <>
|
||||
std::string
|
||||
STInt64::getText() const
|
||||
{
|
||||
return std::to_string(value_);
|
||||
}
|
||||
|
||||
template <>
|
||||
Json::Value
|
||||
STInt64::getJson(JsonOptions) const
|
||||
{
|
||||
auto convertToString = [](int64_t const value, int const base) {
|
||||
XRPL_ASSERT(
|
||||
base == 10 || base == 16,
|
||||
"ripple::STInt64::getJson : base 10 or 16");
|
||||
std::string str(
|
||||
base == 10 ? 20 : 16, 0); // Allocate space depending on base
|
||||
auto ret =
|
||||
std::to_chars(str.data(), str.data() + str.size(), value, base);
|
||||
XRPL_ASSERT(
|
||||
ret.ec == std::errc(),
|
||||
"ripple::STInt64::getJson : to_chars succeeded");
|
||||
str.resize(std::distance(str.data(), ret.ptr));
|
||||
return str;
|
||||
};
|
||||
|
||||
if (auto const& fName = getFName(); fName.shouldMeta(SField::sMD_BaseTen))
|
||||
{
|
||||
return convertToString(value_, 10); // Convert to base 10
|
||||
}
|
||||
|
||||
return convertToString(value_, 16); // Convert to base 16
|
||||
}
|
||||
|
||||
} // namespace ripple
|
||||
|
||||
@@ -653,12 +653,6 @@ STObject::getFieldI32(SField const& field) const
|
||||
return getFieldByValue<STInt32>(field);
|
||||
}
|
||||
|
||||
std::int64_t
|
||||
STObject::getFieldI64(SField const& field) const
|
||||
{
|
||||
return getFieldByValue<STInt64>(field);
|
||||
}
|
||||
|
||||
AccountID
|
||||
STObject::getAccountID(SField const& field) const
|
||||
{
|
||||
@@ -779,12 +773,6 @@ STObject::setFieldI32(SField const& field, std::int32_t v)
|
||||
setFieldUsingSetValue<STInt32>(field, v);
|
||||
}
|
||||
|
||||
void
|
||||
STObject::setFieldI64(SField const& field, std::int64_t v)
|
||||
{
|
||||
setFieldUsingSetValue<STInt64>(field, v);
|
||||
}
|
||||
|
||||
void
|
||||
STObject::setFieldV256(SField const& field, STVector256 const& v)
|
||||
{
|
||||
|
||||
@@ -211,9 +211,6 @@ STVar::constructST(SerializedTypeID id, int depth, Args&&... args)
|
||||
case STI_INT32:
|
||||
construct<STInt32>(std::forward<Args>(args)...);
|
||||
return;
|
||||
case STI_INT64:
|
||||
construct<STInt64>(std::forward<Args>(args)...);
|
||||
return;
|
||||
case STI_VECTOR256:
|
||||
construct<STVector256>(std::forward<Args>(args)...);
|
||||
return;
|
||||
|
||||
@@ -89,12 +89,6 @@ Serializer::addInteger(std::int32_t i)
|
||||
{
|
||||
return add32(i);
|
||||
}
|
||||
template <>
|
||||
int
|
||||
Serializer::addInteger(std::int64_t i)
|
||||
{
|
||||
return add64(i);
|
||||
}
|
||||
|
||||
int
|
||||
Serializer::addRaw(Blob const& vector)
|
||||
|
||||
Reference in New Issue
Block a user