mirror of
https://github.com/XRPLF/rippled.git
synced 2026-04-29 15:37:57 +00:00
28 lines
605 B
C++
28 lines
605 B
C++
#include <xrpld/app/main/Application.h>
|
|
#include <xrpld/rpc/Context.h>
|
|
|
|
#include <xrpl/json/JsonPropertyStream.h>
|
|
#include <xrpl/json/json_value.h>
|
|
#include <xrpl/protocol/jss.h>
|
|
|
|
namespace xrpl {
|
|
|
|
Json::Value
|
|
doPrint(RPC::JsonContext& context)
|
|
{
|
|
JsonPropertyStream stream;
|
|
if (context.params.isObject() && context.params[jss::params].isArray() &&
|
|
context.params[jss::params][0u].isString())
|
|
{
|
|
context.app.write(stream, context.params[jss::params][0u].asString());
|
|
}
|
|
else
|
|
{
|
|
context.app.write(stream);
|
|
}
|
|
|
|
return stream.top();
|
|
}
|
|
|
|
} // namespace xrpl
|