xrpld
Toggle main menu visibility
Loading...
Searching...
No Matches
xrpld
rpc
handlers
admin
status
Print.cpp
1
#include <xrpld/app/main/Application.h>
2
#include <xrpld/rpc/Context.h>
3
4
#include <xrpl/json/JsonPropertyStream.h>
5
#include <xrpl/json/json_value.h>
6
#include <xrpl/protocol/jss.h>
7
8
namespace
xrpl
{
9
10
json::Value
11
doPrint
(
rpc::JsonContext
& context)
12
{
13
JsonPropertyStream
stream;
14
if
(context.
params
.
isObject
() && context.
params
[jss::params].
isArray
() &&
15
context.
params
[jss::params][0u].
isString
())
16
{
17
context.
app
.
write
(stream, context.
params
[jss::params][0u].
asString
());
18
}
19
else
20
{
21
context.
app
.
write
(stream);
22
}
23
24
return
stream.top();
25
}
26
27
}
// namespace xrpl
beast::PropertyStream::Source::write
void write(PropertyStream &stream)
write this source and all its children recursively to the stream.
Definition
beast_PropertyStream.cpp:216
json::Value::isObject
bool isObject() const
Definition
json_value.cpp:1152
json::Value::isArray
bool isArray() const
Definition
json_value.cpp:1140
json::Value::isString
bool isString() const
Definition
json_value.cpp:1134
json::Value::asString
std::string asString() const
Returns the unquoted string value.
Definition
json_value.cpp:494
xrpl::JsonPropertyStream
A PropertyStream::Sink which produces a json::Value of type ValueType::Object.
Definition
JsonPropertyStream.h:15
xrpl
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition
algorithm.h:5
xrpl::doPrint
json::Value doPrint(rpc::JsonContext &context)
Definition
Print.cpp:11
xrpl::rpc::Context::app
Application & app
Definition
Context.h:29
xrpl::rpc::JsonContext
Definition
Context.h:41
xrpl::rpc::JsonContext::params
json::Value params
Definition
Context.h:51
Generated by
1.17.0