mirror of
https://github.com/Xahau/xahaud.git
synced 2026-06-05 01:36:38 +00:00
Format first-party source according to .clang-format
This commit is contained in:
committed by
manojsdoshi
parent
65dfc5d19e
commit
50760c6935
@@ -20,15 +20,15 @@
|
||||
#include <ripple/basics/Log.h>
|
||||
#include <ripple/basics/StringUtilities.h>
|
||||
#include <ripple/basics/safe_cast.h>
|
||||
#include <ripple/beast/core/LexicalCast.h>
|
||||
#include <ripple/protocol/LedgerFormats.h>
|
||||
#include <ripple/protocol/STInteger.h>
|
||||
#include <ripple/protocol/TxFormats.h>
|
||||
#include <ripple/protocol/TER.h>
|
||||
#include <ripple/beast/core/LexicalCast.h>
|
||||
#include <ripple/protocol/TxFormats.h>
|
||||
|
||||
namespace ripple {
|
||||
|
||||
template<>
|
||||
template <>
|
||||
STInteger<unsigned char>::STInteger(SerialIter& sit, SField const& name)
|
||||
: STInteger(name, sit.get8())
|
||||
{
|
||||
@@ -36,41 +36,40 @@ STInteger<unsigned char>::STInteger(SerialIter& sit, SField const& name)
|
||||
|
||||
template <>
|
||||
SerializedTypeID
|
||||
STUInt8::getSType () const
|
||||
STUInt8::getSType() const
|
||||
{
|
||||
return STI_UINT8;
|
||||
}
|
||||
|
||||
template <>
|
||||
std::string
|
||||
STUInt8::getText () const
|
||||
STUInt8::getText() const
|
||||
{
|
||||
if (getFName () == sfTransactionResult)
|
||||
if (getFName() == sfTransactionResult)
|
||||
{
|
||||
std::string token, human;
|
||||
|
||||
if (transResultInfo (TER::fromInt (value_), token, human))
|
||||
if (transResultInfo(TER::fromInt(value_), token, human))
|
||||
return human;
|
||||
|
||||
JLOG (debugLog().error())
|
||||
JLOG(debugLog().error())
|
||||
<< "Unknown result code in metadata: " << value_;
|
||||
}
|
||||
|
||||
return beast::lexicalCastThrow <std::string> (value_);
|
||||
return beast::lexicalCastThrow<std::string>(value_);
|
||||
}
|
||||
|
||||
template <>
|
||||
Json::Value
|
||||
STUInt8::getJson (JsonOptions) const
|
||||
Json::Value STUInt8::getJson(JsonOptions) const
|
||||
{
|
||||
if (getFName () == sfTransactionResult)
|
||||
if (getFName() == sfTransactionResult)
|
||||
{
|
||||
std::string token, human;
|
||||
|
||||
if (transResultInfo (TER::fromInt (value_), token, human))
|
||||
if (transResultInfo(TER::fromInt(value_), token, human))
|
||||
return token;
|
||||
|
||||
JLOG (debugLog().error())
|
||||
JLOG(debugLog().error())
|
||||
<< "Unknown result code in metadata: " << value_;
|
||||
}
|
||||
|
||||
@@ -79,7 +78,7 @@ STUInt8::getJson (JsonOptions) const
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
template<>
|
||||
template <>
|
||||
STInteger<std::uint16_t>::STInteger(SerialIter& sit, SField const& name)
|
||||
: STInteger(name, sit.get16())
|
||||
{
|
||||
@@ -87,56 +86,55 @@ STInteger<std::uint16_t>::STInteger(SerialIter& sit, SField const& name)
|
||||
|
||||
template <>
|
||||
SerializedTypeID
|
||||
STUInt16::getSType () const
|
||||
STUInt16::getSType() const
|
||||
{
|
||||
return STI_UINT16;
|
||||
}
|
||||
|
||||
template <>
|
||||
std::string
|
||||
STUInt16::getText () const
|
||||
STUInt16::getText() const
|
||||
{
|
||||
if (getFName () == sfLedgerEntryType)
|
||||
if (getFName() == sfLedgerEntryType)
|
||||
{
|
||||
auto item = LedgerFormats::getInstance ().findByType (
|
||||
safe_cast<LedgerEntryType> (value_));
|
||||
auto item = LedgerFormats::getInstance().findByType(
|
||||
safe_cast<LedgerEntryType>(value_));
|
||||
|
||||
if (item != nullptr)
|
||||
return item->getName ();
|
||||
return item->getName();
|
||||
}
|
||||
|
||||
if (getFName () == sfTransactionType)
|
||||
if (getFName() == sfTransactionType)
|
||||
{
|
||||
auto item =TxFormats::getInstance().findByType (
|
||||
safe_cast<TxType> (value_));
|
||||
auto item =
|
||||
TxFormats::getInstance().findByType(safe_cast<TxType>(value_));
|
||||
|
||||
if (item != nullptr)
|
||||
return item->getName ();
|
||||
return item->getName();
|
||||
}
|
||||
|
||||
return beast::lexicalCastThrow <std::string> (value_);
|
||||
return beast::lexicalCastThrow<std::string>(value_);
|
||||
}
|
||||
|
||||
template <>
|
||||
Json::Value
|
||||
STUInt16::getJson (JsonOptions) const
|
||||
Json::Value STUInt16::getJson(JsonOptions) const
|
||||
{
|
||||
if (getFName () == sfLedgerEntryType)
|
||||
if (getFName() == sfLedgerEntryType)
|
||||
{
|
||||
auto item = LedgerFormats::getInstance ().findByType (
|
||||
safe_cast<LedgerEntryType> (value_));
|
||||
auto item = LedgerFormats::getInstance().findByType(
|
||||
safe_cast<LedgerEntryType>(value_));
|
||||
|
||||
if (item != nullptr)
|
||||
return item->getName ();
|
||||
return item->getName();
|
||||
}
|
||||
|
||||
if (getFName () == sfTransactionType)
|
||||
if (getFName() == sfTransactionType)
|
||||
{
|
||||
auto item = TxFormats::getInstance().findByType (
|
||||
safe_cast<TxType> (value_));
|
||||
auto item =
|
||||
TxFormats::getInstance().findByType(safe_cast<TxType>(value_));
|
||||
|
||||
if (item != nullptr)
|
||||
return item->getName ();
|
||||
return item->getName();
|
||||
}
|
||||
|
||||
return value_;
|
||||
@@ -144,7 +142,7 @@ STUInt16::getJson (JsonOptions) const
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
template<>
|
||||
template <>
|
||||
STInteger<std::uint32_t>::STInteger(SerialIter& sit, SField const& name)
|
||||
: STInteger(name, sit.get32())
|
||||
{
|
||||
@@ -152,28 +150,27 @@ STInteger<std::uint32_t>::STInteger(SerialIter& sit, SField const& name)
|
||||
|
||||
template <>
|
||||
SerializedTypeID
|
||||
STUInt32::getSType () const
|
||||
STUInt32::getSType() const
|
||||
{
|
||||
return STI_UINT32;
|
||||
}
|
||||
|
||||
template <>
|
||||
std::string
|
||||
STUInt32::getText () const
|
||||
STUInt32::getText() const
|
||||
{
|
||||
return beast::lexicalCastThrow <std::string> (value_);
|
||||
return beast::lexicalCastThrow<std::string>(value_);
|
||||
}
|
||||
|
||||
template <>
|
||||
Json::Value
|
||||
STUInt32::getJson (JsonOptions) const
|
||||
Json::Value STUInt32::getJson(JsonOptions) const
|
||||
{
|
||||
return value_;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
template<>
|
||||
template <>
|
||||
STInteger<std::uint64_t>::STInteger(SerialIter& sit, SField const& name)
|
||||
: STInteger(name, sit.get64())
|
||||
{
|
||||
@@ -181,23 +178,22 @@ STInteger<std::uint64_t>::STInteger(SerialIter& sit, SField const& name)
|
||||
|
||||
template <>
|
||||
SerializedTypeID
|
||||
STUInt64::getSType () const
|
||||
STUInt64::getSType() const
|
||||
{
|
||||
return STI_UINT64;
|
||||
}
|
||||
|
||||
template <>
|
||||
std::string
|
||||
STUInt64::getText () const
|
||||
STUInt64::getText() const
|
||||
{
|
||||
return beast::lexicalCastThrow <std::string> (value_);
|
||||
return beast::lexicalCastThrow<std::string>(value_);
|
||||
}
|
||||
|
||||
template <>
|
||||
Json::Value
|
||||
STUInt64::getJson (JsonOptions) const
|
||||
Json::Value STUInt64::getJson(JsonOptions) const
|
||||
{
|
||||
return strHex (value_);
|
||||
return strHex(value_);
|
||||
}
|
||||
|
||||
} // ripple
|
||||
} // namespace ripple
|
||||
|
||||
Reference in New Issue
Block a user